[Jprogramming] i. (2 2 $ 1 2 3 4)
Henry Rich
henryhrich at gmail.com
Sat Dec 16 02:46:00 UTC 2017
Yeah, you're right, you get empty. I mistyped.
The point is, if you follow the fill rules, you get domain error.
Henry Rich
On 12/15/2017 9:44 PM, Jimmy Gauvin wrote:
> 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 <henryhrich at gmail.com> 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
More information about the Programming
mailing list