Yes, the big differences between 0!:0 and ". on unboxed arguments are:

". returns the noun result from the execution if there is one, 0!:0
always returns $~0 0

". requires a single sentence, 0!:0 allows newlines (and so can handle
multiple sentences including :0 definitions).

Thanks,

-- 
Raul

On Tue, Sep 8, 2020 at 10:52 PM ethiejiesa via Programming
<[email protected]> wrote:
>
> Oh! Duh. I was confused. (0!:0) directly executes the string (or file).
> Much clearer now. Thank you.
>
> Raul Miller <[email protected]> wrote:
> >    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,
>
>
> ----------------------------------------------------------------------
> 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