Closed holyjak closed 2 years ago
I would prefer that as a function rather than a macro:
(resolved-symbol 'my.ns/my-fn)
This makes it more composeable.
I gather rsym
is to cryptic :) But if we have both resolved-symbol
and resolve-symbol
, don't we expose the user to a great riks of mixing them up?
OK, let's add rsym
but as a function.
Sorry, I missed the part about list
. Why do you need this? Often I think list?
should just be seq?
instead, since list?
doesn't match on (cons 1 [1 2 3])
for example.
Maybe I don't? The idea was that function calls in Clojure are calls so it would be natural to search for (list (rsym 'myns/myfn int?))
. But I guess seq works just as well and makes list unnecessary. A proper clojure dev should know that 😅
I recommend using seq?
and to forget about list?
forever :).
Well, in this particular case I really, really want a list because fn calls cannot be lazy sequences :-)
But seq works fine it I guess it is worthwile keeping the api small
The parsed s-expression is usually not a lazy sequence, but it can be a Cons because of macro-expansions.
Ah
Add a convenience macro
list
similar tocat
but checking that it is a list and something that makes it easy to match on a call to a particular function. What I had to do, to find wheremy-fun
is called with three arguments (b/c we are deprecating the arity so I wanted to know where we use it) was:That is obvioulsy quite neat already. But I could have imagined st. like:
where
rsym
is a macro that expands into(s/and symbol? (comp #{<the symbol>} g/resolve-symbol)))
.I would be happy to contribute code for this.