Ah. OK. I wasn't following the discussion closely enough, in part
because I was reading and posting from my cellphone.

The main thing I forgot is that we're discussing *undefined* values
here. So, when looking at the sentence I had in mind (a=: 3 + b) b can
only be an-adverb-that-returns-an-adverb if it is defined when this is
parsed. That requirement is precisely what I meant earlier when I
wrote "operators must be defined prior to invocation."

With regard to what I hope to keep as a main topic, referential
transparency, the important thing to communicate here is that J is not
so declarative as some languages, in that the order of J sentences is
significant in much the same way that imperative code relies upon the
order of statements. Pronouns and non-primary operators must be named
before being referred to. I don't think this removes much referential
transparency, but it is a requirement that may be worth noting as we
review and summarize this topic.

The dependency I'm emphasizing here is mainly a consequence of the
interactive emphasis in J, which is one of J's great strengths.



On Sun, May 17, 2009 at 4:18 PM, Henry Rich <[email protected]> wrote:
> 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
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to