More D newb questions.
Michiel Helvensteijn
nomail at please.com
Mon May 5 15:16:38 PDT 2008
Me Here wrote:
> But C doesn't have ~ concatenation, so there's
> no backwards compatibilty reason for not defining opCat for chars to do
> the only logical thing and produce a char[].
What if you tried to concatenate two types that DO support concatenation of
their own?
You're suggesting the concatenation operator could work like this:
operator~: T x T -> T[]
If T is already an array, however, you wouldn't want those semantics. Would
you have it work only on primitive types? That would make it a very
inconsistent behavior and I'd rather see the error than have D guess that I
need an array.
--
Michiel
More information about the Digitalmars-d
mailing list