I've run into that difficulty before. My efforts to accomplish this sort of
"reaching beyond current scope" brought me to decide that doing so runs so
against-the-grain of J that this is not a limitation I wish to overcome in
J. Instead, I take it as a clue that there may be a very different way of
accomplishing the main goal. If not, I'd select a different language.

--
Tracy


On Tue, Jan 25, 2011 at 10:06 PM, Ian Clark <[email protected]> wrote:

> > The question is why you are doing this.
>
> I'd rather not go into that. You have to study the middleware I'm
> porting from APL to relate to why I need a function which knows the
> name of its caller. And without the caller having to go to the trouble
> of telling it. The tool makes heavy use of two utility functions:
> "myname" and "mycaller", whose function should be obvious, even if
> their application isn't. And please don't ask why a function might
> conceivably need to discover its own name: the requirement has been
> known to arise.
>
> In APL the solution is easy: the stack is always available for a
> function to inspect while it's running. In J you have to switch the
> suspension stack on. Is this because the facility is quirky and
> inefficient, or simply because a lot of people don't need it or want
> it -- as I don't, as a rule?
>
> "mycaller", implemented the APL way, is working fine (touch-wood). But
> if there's a slick J technique without enabling the suspension stack
> then it would simplify the code considerably and I can lose a few
> heavily-looping saddle-functions.
>
>
>
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to