This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-07-27
Channels
- # announcements (3)
- # babashka (16)
- # beginners (177)
- # calva (102)
- # cider (2)
- # clj-kondo (12)
- # clojars (10)
- # clojure (91)
- # clojure-argentina (3)
- # clojure-australia (5)
- # clojure-europe (16)
- # clojure-nl (1)
- # clojure-uk (10)
- # clojurescript (73)
- # community-development (8)
- # cursive (9)
- # depstar (7)
- # fulcro (5)
- # helix (1)
- # introduce-yourself (1)
- # jobs-discuss (18)
- # lsp (32)
- # luminus (1)
- # malli (2)
- # music (4)
- # off-topic (20)
- # pathom (19)
- # polylith (15)
- # re-frame (4)
- # reagent (6)
- # ring (13)
- # sci (36)
- # shadow-cljs (7)
- # spacemacs (4)
- # sql (3)
- # tools-deps (112)
- # vim (21)
Is there a workaround for structural search for Clojure? I want to find usages of an overloaded function that is called with x number of arguments. A regex grep will be a pain, since I'll have to handle new lines and threaded forms.
No, there isn’t unfortunately. Searching for a particular arity is something that has been requested before.
https://github.com/borkdude/grasp allows you to "grep" a codebase with specs that include arity counts
It is sort of sidestepping the problem, but the easier migration would be to move all usages of the function to using a map with named params
that way you don't need to narrow down anything and in the future you can search for the map's keys for future revisions
I actually found an example that I can very easily build on https://github.com/borkdude/grasp/blob/master/examples/arg_vecs.clj. Thanks @U11BV7MTK
@U3JH98J4R That's too big a diff, the function has 209 usages. And my need for refactoring is for quite a different purpose.