I fear it's impossible to come up with a perfect solution for this: if you look at the line A←B C D
- what is it? Are we stranding the 3 variables B C D
or are we calling function B
with argument (C D)
or perhaps calling function C
with B
and D
as arguments? And while B
might be a function now, it is still possible that the code in the lines just before this statement ⎕EXes B
and declares a local variable B
etc. And if you have no knowledge about B
, C
and D
- this could could mean anything...
Now...if you are just looking for occurrences of fooNction
you could gather those calls and inspect'em - but what if you see an argument H
? It could be a niladic function that returns a vector of 2 or 3 or more elements...
The dynamic nature of APL makes such static analysis...,eh, difficult or even impossible.
Do it anyway - DIY
You replied "It could be a niladic function that returns a vector of 2 or 3 or more elements... I consider it as a single argument then. This is enough for my task." - any you're not alone with that! Many APLers have had similar wishes regarding their code - and like you, they'd been happy to accept limitations in the analysis. But the limitations you accept depend on the questions you ask - and probably that's why there hasn't been enough energy to come up with a "community effort" for it. And, ofc, there's the idea that "it's only a few lines of code", so why bother - but fortunately there also is a trend towards building and using libraries.
Just to throw in a few ideas how you could deal with analysing calls of fooNction
:
∇ test function
nr←⎕NR function
matches← ('fooNction(.*)(⋄|$)$'⎕s'\1')nr
:for m :in matches
⍝ do something with m...
:endfor
∇
This will find all calls of fooNtion
(results will just contain the right argument ), so you could then either visually inspect those calls or try some string analysis do extract and count distinct entities.
Update:
I shared your question with a famous (but banned AI) tool. The answer is hilarious - I wish I could answer so inaccurately with such certainty myself!
