On Sun, Apr 10, 2011 at 10:19 AM, Boyko Bantchev <[email protected]> wrote:
> On 10 April 2011 02:24, Raul Miller <[email protected]> wrote:
>> But being uncertain implies some doubt about what the meaning could
>> be, and I am not seeing any non-trivial basis for doubt here.
>
> Well, u/y, for 1=#y, could be imagined to be an erroneous expression.
> Or, it could be the Indeterminate value.  What's wrong with that
> interpretation?  But I stress again -- all these are only speculations,
> and there would be no room for them if the definition itself was
> unequivocal.

In the past, J has been extended to give erroneous expressions a
non-erroneous meaning, and those have been thought of as compatible
extensions of the language.

>> But... the dictionary says:
>>   u/y applies the dyad u between the items of y
>>
>> u is -
>> y is 3 5 9 2
>>
>> It seems to me that if you insert - between the items of 3 5 9 2 you
>> get 3-5-9-2
>
> That again is plausible but not certain, as it seems to me.
> `Applies between' does not specify order; it could still be
> ((3-5)-9)-2 -- as it is in K, by the way -- despite K also
> evaluating, in general, in a righ-to-left order.

But this is not K.  If K semantics were intended by the dictionary,
and they were not explicitly specified, that would be wrong.  But why
should the J dictionary have to assert that J semantics are to be
used?

> I would have no doubt if the definition said, e.g.,
> `u/y, for y = y1 ... yn and n>1, is equivalent to the expression
> y1 u y2 u ... u yn'.

Why would you know, in this case -- but not the other case -- that the
dictionary was not talking of a K expression?

>>> Does +/'z' not read as `summing up a string' -- which is what I mean
>>> by `meaningless'?
>>
>>You could read it that way, though 'z' is a character, for the usual
>>meaning of a string, you would want ,'z' (a string has a length -- in
>>other word's it's a rank 1 array of characters).
>
> Ok, but u/ does not actually discriminate between 'z' and ,'z'.
> Expressions such as +/'z' (summing up a character) or +/,'z' (summing
> up a string) seem equally meaningless.

   (-: [:/) 'z'
1
   (-: [:/) ,'z'
0

>>But although +/ can be thought of as sum, it's also reasonable to
>>think of it as "plus insert", and there may be other reasonable ways
>>to conceptualize the operation (depending on the domain).  For
>>example, if the domain is arrays consisting only of zeros and
>>infinities, +/ could be thought of as a boolean reduction.
>
> What I am drawing attention is that in u/y, for whatever u and 1=#y,
> u is totally irrelevant, be it +, *, %: or anything else.  Which,
> in turn, makes expressions like +/'z' or +/1 3$'abc' strangely
> acceptable.  What for would I need them?  I really see this as
> one of the several anomalies in the definition of /.

I suppose you are arguing that J should reject cases of u/y where y
contains elements which are not in the domain of u.

But, in the general case, is not a computable issue (it's equivalent
to solving the halting problem, in the general case).

So the counter-side of this argument would be: what use is it to you,
to have J reject such cases?

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

Reply via email to