never seen that (0&#) "trick" before, this may be more standard:

definedwhere=: ((<'Not from script') ,~ [: 4!:3 ''"_) {~ 4!:4@boxopen


----- Original Message -----
From: Henry Rich <[email protected]>
To: [email protected]
Cc: 
Sent: Sunday, August 31, 2014 11:46:00 AM
Subject: Re: [Jprogramming] Need help with defining a verb

Apply 4!:3 to the result of a verb rather than a noun.  This delays 
execution.

whichscript =: ((<'Not from script') ,~ 4!:3@(0&#)) {~ 4!:4@boxopen

Henry Rich

On 8/31/2014 11:37 AM, Vijay Lulla wrote:
> Dear J-ers,
>
> How would I define a verb 'definedwhere' which finds out where a particular
> item got defined?  I.e. using 4!:3 and 4!:4 utilities...but dynamically.
> For e.g.,
>
>     definedwhere 'nl'
> /Users/v/j64-802/system/main/stdlib.ijs
>     NB. This is similar to
>     (4!:4 <'nl') { 4!:3''
> /Users/v/j64-802/system/main/stdlib.ijs
>
> So, I defined the following in my startup script.
>
>     definedwhere=: (4!:3''){~ boxopen
>
> but it does not work because 4!:3'' gets executed during the definition.  I
> need it to be done dynamically because the script list will change in the
> interactive session.  How can I go about this?
>
> Thanks,
> Vijay.
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm



>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to