Doesn't look that way:

    a =: 1 + b&+
    b =: 1 : 'b'
    a 5
|domain error: b
|       a 5
    b =: 1 : '/'
    a 5
|domain error: b
|       a 5

Undefined b is assumed to be a verb.  When a sentence is parsed, b might 
be inside something like b&.> that is replaced by a single anonymous 
verb that knows how to handle the compound.  If, when  execution starts, 
it turns out that b isn't a verb, Roger would have to back up in the 
parse and try parsing with the new part of speech.

Henry Rich

Tracy Harms wrote:
> It could be an adverb that returns an adverb, couldn't it?
> 
> On 5/17/09, Henry Rich <[email protected]> wrote:
>> 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
>>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
> 
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to