Raul Miller <[email protected]> wrote:
> >> My reading of these two concepts suggests that x and y are sometimes
> >> prohibited as global names. ?And, it's easy enough to conduct an
> >> experiment to test this concept:
> >>
> >> ? 3 :'y=:0' 0
> >> |domain error
> >> | ? y ? ?=:0
> >
> >
> > This is not because y is forbidden as a global name.
>
> I do not think that "sometimes prohibited" and "forbidden" mean the same 
> thing.

Use of global x and y is NEVER prohibited. They are just more difficult to
access, since one and/or the other is always masked by a local variable
within any explicit definition. However, these can easily be circumvented
by use of locales, or by stepping out of the definition, or using only tacit
verbs.

   x =: 4
   y =: 3
   X =: 3 :'x'
   Y =: 3 :'0(1 :''y'')'
   v =: 4 : '(X+Y)0'
   10 v 20
7
   w =: 4 : 'x__+y__'
   10 w 20
7
   t =. ".@:('x'"_) + ".@:('y'"_)
   10 t 20
7

-- Mark D. Niemiec <[email protected]>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to