> But I think this is an error, if not explicitly documented
> in the dictionary: local definitions in scripts vanish when
> the script completes (in other contexts) which suggests
> that scripts should have a different local context from the
> calling environment.
...
> This is slightly different, but follows from your first
> example (since the script context is the same context
> as the body of your 3 : definition, the local definition
> from the 3 : context interferes with the global definition
> from the script context).

It is misleading to speak of "local definitions in 
scripts" and "script context", since only explicit 
defn (m : n) can have local definitions.  If it helps,
in Oleg's examples the 0!:0 can be replaced by ". 
and the effects would be the same.



----- Original Message -----
From: Raul Miller <[EMAIL PROTECTED]>
Date: Tuesday, August 7, 2007 6:23
Subject: Re: [Jprogramming] Standalone Error wdhandler_base_
To: Programming forum <[email protected]>

> On 8/6/07, Oleg Kobchenko <[EMAIL PROTECTED]> wrote:
> > NB. strange (not a value error)
> >   3 : 't [ 0!:0 ''t=. 1+1'' ' 0
> > |domain error: t
> > |       t[0!:0't=. 1+1'
> 
> Since you did not elaborate on what seems to be happening
> here:
> 
> When parsing the body of the 3 : expression
> J will see
>    verb noun conjunction noun noun
> but then after resolving the conjunction it
> will see
>    verb verb verb noun
> 
> Then, it will evaluate the monad treating the remaining
> noun as a script.
> 
> But apparently it does not re-examine those verbs
> to see if any of them have changed after executing
> the first as a monad.  (If it allowed syntactic types
> to change after it examined them, what should it
> do if a verb becomes and adverb or conjunction?)
> 
> I'm pretty sure that that domain error comes from
> trying to evaluate the left-most 'verb' as a monad.
> Its definition is bogus.
> 
> But I think this is an error, if not explicitly documented
> in the dictionary: local definitions in scripts vanish when
> the script completes (in other contexts) which suggests
> that scripts should have a different local context from the
> calling environment.
> 
> > NB. moreover it is blocking =:
> >   3 : 't [ 0!:0 ''t=: 1+1'' [ t=.3 ' 0
> > |domain error
> > |   t    =:1+1
> > |[-0]
> 
> This is slightly different, but follows from your first
> example (since the script context is the same context
> as the body of your 3 : definition, the local definition
> from the 3 : context interferes with the global definition
> from the script context).
> 
> -- 
> Raul
> 
> Note also:
> 
> 
> -- 
> Raul
 
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to