comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: !null values in arrays
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: !null values in arrays [message #74042 is a reply to message #74040] Thu, 16 December 2010 07:14 Go to previous messageGo to previous message
Paul Van Delst[1] is currently offline  Paul Van Delst[1]
Messages: 1157
Registered: April 2002
Senior Member
Hello,

Axel M wrote:
> Hi Gray,
>
> I see your point and agree to some extent. But I would also see the
> opposite arguments: what should then be the result of 3 * !NULL or
> 3 / !NULL ? Do you propose that !NULL is handled as a 0? This might
> often lead to more confusion, and for indexing purposes it is
> definitely not a 0.

In IDL, storing a null in an otherwise homogeneous array makes said array a list. Why not use a list? The OP could still
call it an array.... :o)

Purely for perspective into the issue, ruby handles operations with null values thusly:

irb(main):001:0> 3 + nil
TypeError: nil can't be coerced into Fixnum
from (irb):1:in `+'
from (irb):1

and python similarly:

>>> 3 + None
Traceback (most recent call last):
File "<stdin>", line 1, in ?
TypeError: unsupported operand type(s) for +: 'int' and 'NoneType'



cheers,

paulv
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Viewing and Printing PostScript Files
Next Topic: ITT VIS at the 2010 AGU Fall Meeting

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Thu Oct 09 22:10:29 PDT 2025

Total time taken to generate the page: 0.16045 seconds