If I define two or more verbs tacitly like this:

act1 =: action
act2 =: action
...

how, inside the verb: action, can I identify the calling verb --
ideally as the literal name, eg 'act1'?

I can solve the problem ...

(a) by having the caller pass its own name as an argument in a rather
more complex tacit expression, eg

act1 =: action bind 'act1'
act2 =: action bind 'act2'
...

(b) by enabling suspension with: (13!:0)1 (in the caller of act1,
act2) and then inspecting the stack within action by means of  0{"1
(13!:13 '')
...which is what I'm using at present.

(a) is not out of the question, but complicates the code, especially
generated code.
And I don't like (b) -- besides being clumsy I anticipate gotchas in
the long term.

Am I right to feel edgy about (b), for general application?

Is there a neater way?
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to