I don't think you're right about this.  b has to be a verb to get  results:

    a =: 1 + b&+
    b =: +
    a 5
6
    b =: 7
    a 5
|domain error: b
|       a 5


Henry Rich

Viktor Cerovski wrote:
> 
> bill lam-2 wrote:
>> On Sat, 16 May 2009, Tracy Harms wrote:
>>> invocation, and verbs must be defined prior to execution.
>> IIRC undefined name are treated as verb. Suppose b is not yet defined,
>>
>>    a=: 3 + b
>>    a
>> 3 + b
>>    b=: 1
>>    a 10
>> |domain error: b
>> |       a 10
>>    b=: *:
>>    a 10
>> 103
>>
> It's a bit more complicated. b is more like a free variable of universal
> type,
> which means it can become anything: noun, verb, adverb or conjunction.
> 
> Such semantics is unusual (I can think only of Mathematica here), 
> and the up side is that some things, like mutually recursive verbs, or
> parametric verbs, are easy to define, but the down side is that we 
> don't know whether some expression with such a free variable will become
> well formed in the course of further interpretation or not, just as your
> example
> illustrates.  
> 
> Another apparently similar, but meaningless, expression is:
>    c=:d+1
> |value error: d
> |   c=:    d+1
> 
> 
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to