Why Strings as Classes?

BCS ao at pathlink.com
Mon Aug 25 18:00:51 PDT 2008


Reply to Benji,

> slicing: broken

works as defined

> indexing: busted

works as defined

> iterating: fucked

works as defined and with foreach(dchar) as you want

> length: you guessed it

works as defined

> Provide an API (yes, implemented in the
> standard lib, but specified by the language spec) that actually makes
> sense for text data.

BTW everything in phobos under std.* is /not part of the D language spec/.

> 
> (Incidentally, this is the same reason I think the builtin dynamic
> arrays should be classes implementing a standard List interface, and
> the associative arrays should be classes implementing a Map interface.
> The language implementations are nice, but they're not polymorphic,
> and that makes it a pain in the ass to extend them.)
> 

A system language MUST have arrays that are not classes or anything near 
that thick. If you must have that sort of interface, pick a different language, 
because D isn't intended to work that way.

> --benji
> 





More information about the Digitalmars-d mailing list