Why Strings as Classes?

Michiel Helvensteijn nomail at please.com
Wed Aug 27 11:21:10 PDT 2008


Dee Girl wrote:

>> Where am I argueing for bad design? All I've been arguing for is looser
>> restrictions for the subscripting operator. You should be able to use it
>> on a list, even though the complexity is O(n). But if it is used often
>> enough (in a deeply nested loop), the compiler will probably
>> automatically use an array instead.
> 
> The idea is nice. But I think it can not be done. Tool is not mind reader.
> If I make some insert and some index. They want different structure. How
> does the tool know what I want fast?

In the future it may be possible to do such analysis. If the indexing is in
a deeper loop, it may weigh more than the insertions you are doing. But
failing that, the programmer might give the compiler 'hints' on which
functions he/she wants faster.

-- 
Michiel




More information about the Digitalmars-d mailing list