On Tue, Aug 4, 2009 at 9:20 AM, neville holmes<[email protected]> wrote:
> Raul Miller wrote:
>>Consider:
>> ? avg1=: +/ % #
>> ? avg2=: [. % ].
>> ? avg3=: f % g
>>
>> if avg1 is a verb, and if avg2 would
>> be a conjunction, what would avg3 be,
>> and how could you tell?
>
> Isn't this a problem anyway ?   (Even if avg2 is
> ignored.)  I seem to remember that if f or g aren't
> defined then the J interpreter assumes they are verbs.

I thought the point of your proposal was to tacitly
define adverbs and conjunctions?  If J were to
treat them as verbs, they would be useless.

   v=: + w
   w=: /
   v 1 2 3
|domain error: w

Here, w is an adverb which J has decided to treat
as a verb.

Of course, if J treats w as an adverb, everything
works fine.

   v f.
|domain error
   v
+ w
   v=: + w
   v
+/

>> ? 1: + 2: * 3: - 4: % [. ^ 6:
>>
>> If this train is an adverb, the top level fork
>> which has + for its middle tine must be treated
>> differently than if the train were a verb.?
>> But neither of its other "verbs" are [. nor ].
>
> Isn't it just
>
> ? (1: + (2: * (3: - (4: % ([. ^ 6:)))))

Yes.

> If you're worried about [. bringing in a noun
> then you can require [. only to be used as an
> operand, and then something like [."_ can be
> used in a train.

That was not the issue I was discussing here.

The issue I was discussing here was whether
J's mechanism for handling [: could be used
for handling [. -- and the above example was
illustrating one of the reasons this mechanism
could not be used.

>> But let us say the following are illegal:
>> ? f=: [.
>> ? g=: ].
>>
>> This could avoid both of the above difficulties
>> -- unless we insisted on using the mechanism
>> which is used to handle [:
>
> You've lost me there.  Sorry.   Perhaps you are
> saying that operations defined with [. or ]. should
> not be nested ?

No, once again -- I was talking about whether the
mechanism used for [: would be useful here.

>> That said, Neville has made lots of suggestions,
>> and some of my above examples would not be allowed
>> with some of his suggestions.
>
> I thought I'd only suggested [. and ]. to be used
> to bring in operands, with the suggestion (as above)
> that they could be required to be only used as
> operands.   Have I forgotten something ?

For example, one of your proposal variants was that
[. and ]. could not be used in trains -- that they could
only be used as arguments to adverbs and conjunctions.

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

Reply via email to