That's funny, I get an empty vector in J and APL for 5+''.

Getting a 5 might be usefull/interesting.

On Fri, Dec 15, 2017 at 8:05 PM, Henry Rich <[email protected]> wrote:

> The current behavior was designed to make sure that
>
>    5 + ''
> 5
>
> doesn't throw an error.  This is a 55-year-old APL idiom.
>
> Henry Rich
>
> On 12/15/2017 7:03 PM, Raul Miller wrote:
>
>> I've been thinking about this, and I am slightly convinced.
>>
>> That said, I would be interested in seeing a real example where this
>> matters.
>>
>> Specifically: in this example you are getting an empty noun with a
>> rank lower than what you should otherwise expect.
>>
>> That suggests one of two likely treatments:
>>
>> (a) The unintended shape causes an error.
>>
>> (b) The unintended shape gets treated as an empty result.
>>
>> (If the programmer has been coding defensively (which is to say not
>> expecting deep understanding of the mechanisms of connected
>> components) then I do not see how your proposal changes the picture.)
>>
>> It could of course - but that's why I'd like to see a real example.
>>
>> (Of course, none of this is an excuse for not testing code against
>> boundary conditions.)
>>
>> Thanks,
>>
>>
>
> ---
> This email has been checked for viruses by AVG.
> http://www.avg.com
>
> ----------------------------------------------------------------------
> 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