Native GTK2 D Bindings

bearophile bearophileHUGS at lycos.com
Mon Jan 23 15:18:55 PST 2012


Artur Skawina:

> There is no such thing as a language mandated identifier naming convention.
> If you think otherwise - make the compiler enforce it. :)

There is a D style guide.


> > This line of code seems an example for people that like named arguments in D:
> > gtk.init(null,null);
> 
> This has nothing to do with named arguments,

It's an example of code where named arguments are useful for the person that reads the code to know what those two arguments are :-)


> Requiring explicit casts for most strings is ugly, but not something
> that can be fixed both safely and cheaply. For a GUI toolkit the
> amount of casts needed may be acceptable. [1]

But a string is like a 2-tuple, it's not a pointer. It's not meant to allow a cast to pointer. So it's better to cast the ".ptr" of an array:
cast(char*)"Hello World!".ptr

Bye,
bearophile


More information about the Digitalmars-d-announce mailing list