Necessities for Adoption of D

bearophile bearophileHUGS at lycos.com
Sun Feb 10 09:36:06 PST 2008


Vladimir Panteleev Wrote:
> D isn't too far off with "with" statements. Example DFL code:
> with(tb = new TextBox) { bounds = Rect(100, 100, 200, 200); multiline = true; readOnly = false; wordWrap = true; parent = this; }

This is shorter and I think it looks better, with less syntax:
auto tb = TextBox(space1).size(400, 200).multiline(1).readonly(0).wrap(1).justify("left");

In D you may want to use camelCase to move your fingers a bit more:
auto tb = TextBox(space1).size(400, 200).multiLine(1).readOnly(0).wrap(1).justify("left");


> And with the new full closures, you can implement event handlers inline, too.

I don't use D 2.x, but I presume a good Wax-like wrapper can be written for D too :-)

Bye,
bearophile



More information about the Digitalmars-d mailing list