Re: LIST extensions [message #74104 is a reply to message #73973] |
Thu, 23 December 2010 06:00   |
Jeremy Bailin
Messages: 618 Registered: April 2008
|
Senior Member |
|
|
On Dec 22, 6:47 pm, Paulo Penteado <pp.pente...@gmail.com> wrote:
> On Dec 14, 8:31 pm, Paulo Penteado <pp.pente...@gmail.com> wrote:
>
>> This is very pertinent. Those are important needed features / bug
>> fixes that were missed in the way lists and hashes were implemented.
>> They are good ideas to add to the class I started implementing, which
>> will also include deep copy, conversion to/from pointer arrays, and
>> fix those issues with non existing elements.
>
> Other changes I am considering to put in my derived classes:
>
> 1) Make lists do nothing (as hashes already do) if !null is used as
> index on _overloadBracketsLeftSide.
>
> 2) Make lists and hashes return !null when !null is used as an index
> (now they throw an error).
>
> 3) Make lists and hashes accept !null on the _overloadPlus method and
> do nothing, instead of throwing an error.
>
> (3) is to work in conjunction with (2), so that lists/hashes can be
> added to indexed lists/hashes, without having to verify if the index
> is not !null.
>
> Any thoughts?
I think (3) is a good idea on its own, regardless of (2). !null seems
to me a natural convention for an empty list/hash.
(but this is coming from someone who hasn't yet used IDL8...)
-Jeremy.
|
|
|