Pascal Jasmin wrote:
>    ] history =: ([ , f) Closure 3
> ] 3 : '] STATE_33_ =: STATE_33_ function_33_ y'
>    history 3
> |value error: f
> why does f get a value error?

'f' is not defined in locale 33.

Possible resolutions:

[1] use f.
   ([ , f f.) Closure 3

[2] Explicitly reference current locale
   blah=: [ , f
   blah_base_ Closure 3

[3] use coinsert
   cocurrent 'nonand'
   coinsert  'base'

(if in session, follow that by):
   cocurrent 'base'

Note, however, that f was defined using 3 : so you will get a 
domain error in a dyadic context.  You might instead want to use
   history =: ([ , [EMAIL PROTECTED]) Closure 3

Finally, note that all this indirect state manipulation tends to
get obscure.  To figure out what was going on, I had to:

[a] Reproduce the examples leading up to the error
[b] Examine the definition of history
[c] Examine names in the referenced locale for the non-error
    example (in my case: names_2_'')

At that point it became clear that the left argument to
Closure winds up as a function definition in the new
domain.  Sadly, the adverb argument (u) is not associated
with any locale -- thus losing the original association
with the context where the adverb was invoked.  This tends
to require some explicit effort to retain the association
between names and definitions.

The f. approach recognizes that the is nothing in the original
locale which is needed, and simply brings the definition into
the new locale.  The other two approaches I proposed retain
the association between the name and the original locale.

P.S. I note that when you quote messages I write using this
email client, the quoted messages are double spaced (with a
blank line between each quoted line).  Do they appear double
spaced when I send them, or is this an artifact of your
quoting mechanism?

Thanks,

-- 
Raul


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

Reply via email to