Why Strings as Classes?

Steven Schveighoffer schveiguy at yahoo.com
Tue Aug 26 11:09:05 PDT 2008


"Robert Fraser" <fraserofthenight at gmail.com> wrote in message 
news:g91fva$1if4$1 at digitalmars.com...
> Lars Ivar Igesund wrote:
>> Robert Fraser wrote:
>>
>>> superdan wrote:
>>
>>>> btw my respect for tango improved when i found no opIndex in their list
>>>> container.
>>>
>> http://www.dsource.org/projects/tango/browser/trunk/tango/util/collection/LinkSeq.d#L176
>>
>> This particular collection package is deprecated.
>
> The new package has this feature too:
> http://www.dsource.org/projects/tango/browser/trunk/tango/util/container/Slink.d#L248
>
> It's a good feature to have (I wouldn't consider a list class complete 
> without it), it just shouldn't be abused.

First, Slink is not really the public interface, it is the unit that 
LinkedList (and other containers) use to build linked lists.

Second, LinkedList implements a 'lookup by index', through the get function, 
but note that it is not implemented as an opIndex function.  an opIndex 
implies fast lookup (at least < O(n)).

I don't think these functions were intended to be used in sorting routines.

-Steve 





More information about the Digitalmars-d mailing list