"Roelof K. Brouwer" <[EMAIL PROTECTED]> wrote:

> If I do the following I get a strange result 
>
> a=:$@:0:
>
> b=:({.);( $: }.@:])
>
> c=:<:#@:]
>
> ([EMAIL PROTECTED]) f.
>
>  Of
>
> 
>
> $@:0:`(3 : '{. ; ($: }.@:]) y' :(4 : 'x {. ; ($: }.@:]) y'))@.(<: #@:])
>
> 
>
> Any explanations

According to the dictionary: '$: denotes the longest verb that contains it.'
When a phrase containing $: is embedded into another, the meaning of $:
changes, since it context changes.

To prevent it from doing so, its scope must be localized somehow, via
assignment, or within the context of some primitive like : or ". or 128!:2

Since code within : isn't ambivalent, f. doesn't know whether b is
monadic or dyadic, so it must make both cases explicit separately
although I suppose it COULD have used a sincle three-line definition:
  3 : ('{. ; ($: }.@:]) y';':';'x {. ; ($: }.@:]) y')

In an unrelated issue, I am wondering what you are trying to do with b;
it looks like it will recurse infinitely. Perhaps you really WANTED $:
to include all of ([EMAIL PROTECTED]) ? If so, putting it within b will give you
the wrong result.

-- Mark D. Niemiec <[EMAIL PROTECTED]>

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

Reply via email to