When D is not nice

David Wilson dw at botanicus.net
Mon Jul 7 07:49:11 PDT 2008


Correct me if I'm wrong, but I think the forthcoming support for
overload sets and free functions will allow definition of a simple
module to alleviate this.

import somewhere.easyconcat;

defining a bunch of extra opCats for simple types.


On Sun, Jul 6, 2008 at 9:30 PM, Frank Benoit <keinfarbton at googlemail.com> wrote:
> String concatenation in Java:
>
> "abc " + a + " bla";
>
> where a is an interface ref.
>
> Ported to D, this look like this:
>
> "abc " ~ (cast(Object)a).toString ~ " bla";
>
> This are 3 steps more:
> 1.) explicit cast to Object (interface/class compatibility!)
> 2.) explicit call to toString
> 3.) put additional parentheses
>
> I would be happy if we could remove all three of this annoying points.
>



-- 
Science without religion is lame, religion without science is blind.
 — Einstein


More information about the Digitalmars-d mailing list