On Sep 5, 2009, at 10:20 PM, Roger Hui wrote:

>> The default behavior (to answer Roger's question), is that nil  OP X
>> returns nil in most cases.
>
> In an array language such as J this behaviour
> leads to some unpleasant effects.  For example,
> if nil really is the answer for 3$nil, some identities
> about $ would have to be jettisoned.
> Even for a scalar language, you have to be careful
> about giving nil as the answer for nil=nil.

Roger,

I agree.  I have already replied again, with specific suggestions to  
the examples you asked about (but I don't yet see it on the list :-?  ).

In general, NODATA equivalency tests succeed (or fail), but comparison  
tests and most other operators should cause Domain errors.

Boxing a NODATA should be possible, as well as unboxing it, but doing  
most other things except recognizing it (with equivalency tests)  
should cause an error.

This would allow a NODATA to occur (somehow) in an array, and be  
selected out of that array, but any other operations on the NODATA  
array elements should cause a Domain error.

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

Reply via email to