example=: 3 :'echo 1'
   0!:0'example'
   0!:0'example 0'
1

Put different: when you evaluate a bare name which references a verb,
the result of that execution is the named verb. You have to give the
verb an argument to execute it.

Also:

   a=. 3
   0!:0'a'
   a
3
   0!:0'a=. 4'
   a

(But, also, any explicit verb, when executed, gets a new local
namespace for that execution instance.)

Anyways... there is no local context from 0!:0.

I hope this helps,

-- 
Raul

On Tue, Sep 8, 2020 at 10:37 PM ethiejiesa via Programming
<[email protected]> wrote:
>
> Say we have a file ~home/script.jis with the following contents:
>
>     a=. 'bar'
>
> and start a J session:
>
>        a=. 'foo'
>        verb=. 0 :0
>     a=. 'baz'
>     )
>        a
>     foo
>        0!:0 <jpath '~home/script.ijs'
>        a
>     bar
>        0!:0 'verb'
>        a
>     bar
>
>        NB. Version info
>        9!:14''
>     j901-f/j64/linux/release/GPL3/voidlinux.org/2020-06-25T01:06:25
>        JLIB
>     9.01.24
>
> So it looks like the (0!:0) foreign works within the calling private namespace
> when executing files, but in contrast, starts a new private namespace when
> executing nouns.
>
> Is my interpretation correct? I assume this behaviour is documented on the
> wiki, but my searches have failed me.
>
> Anyway, (0!:0)'s behaviour of muning the caller's private namespace is used to
> great effect in profile.ijs, by looking for a ~home/.jprofile.ijs to let users
> override the directories in SystemFolders_j_.
>
> Is the execution of (0!:0 'noun') equivalent to (3 :0) when the string 
> contents
> are the same?
>
>
> Cheers,
> ----------------------------------------------------------------------
> 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