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

Reply via email to