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

Home » Public Forums » archive » Re: LIST "bug": .Remove on an empty list
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: LIST "bug": .Remove on an empty list [message #73990 is a reply to message #73989] Tue, 14 December 2010 08:06 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
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)


> 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)

Or, more likely:

Function List::IsEmpty
@boolean_codes
IF N_Elements(self) EQ 0 THEN RETURN, TRUE ELSE RETURN, FALSE
END

where "TRUE" and "FALSE" are defined (correctly :o) in the boolean_codes.pro include file.


cheers,

paulv
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: LIST performance
Next Topic: LIST "bug": .Remove on an empty list

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

Current Time: Wed Oct 08 19:31:29 PDT 2025

Total time taken to generate the page: 0.00419 seconds