Re: LIST "bug": .Remove on an empty list [message #73989 is a reply to message #73988] |
Tue, 14 December 2010 08:17   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Paul van Delst writes:
> David Fanning wrote:
>> I can't stop to look into this today (18 pages yesterday!!),
>> but why can't you just write this ISEmpty method for yourself?
>
> I have. But I believe it should be part of the standard library in IDL. A user shouldn't have to extend a class for such
> basic functionality.
>
> Philosophically, I'm a "just because you can extend a class doesn't mean you should" type of guy.
> Pragmatically, I'm a "just extend the damn class!" fellow. :o)
I can tell you haven't been working with IDL very long. :-)
>> Function List::IsEmpty
>> IF N_Elements(self) EQ 0 THEN RETURN, 0 ELSE RETURN, 1
>> END
>>
>> That would work, que no?
>
> Well, no. I would do something like
> IF N_Elements(self) EQ 0 THEN RETURN, 1 ELSE RETURN, 0
>
> :o)
Uh, right. I don't program well under pressure. :-(
Cheers,
David
P.S. Let's just say if we had to wait for ITTVIS
to get it together, we would still be working with the
TV and CONTOUR commands. ;-)
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|