Fork me on GitHub
#clj-kondo
<
2023-02-10
>
Noah Bogart19:02:25

Related/follow-up: clj-kondo.impl.rewrite-clj.parser/parse-string doesn't seem to parse anonymous functions in a way that notes they're functions:

; eval (current-form): (p/parse-string "#(+ 1 %)")
{:children
 ({:value +, :string-value "+"}
  {:value 1, :string-value "1"}
  {:value %, :string-value "%"})}
is that intentional? is there another method for parsing input that clj-kondo uses? i'm not sure exactly how it determines what's an anonymous function

borkdude19:02:22

How is this different from normal rewrite-clj? What is the background of your question?

borkdude19:02:33

Of course clj-kondo can parse such functions as it has to analyze those functions

Noah Bogart19:02:10

i'm using clj-kondo's parser directly because i'm writing an s-expression pattern matching library for use with clj-kondo

borkdude19:02:31

The node/tag of that expression determines that it is a function

👍 2
Noah Bogart19:02:17

oh interesting. thanks