Suggestions

Daniel Keep daniel.keep+lists at gmail.com
Mon Dec 4 05:24:09 PST 2006


vincent catrino wrote:
 > Hi there,

Howdy, and welcome to the NG.  Please keep your arms and legs inside the 
NG at all times, lest you lose them. :P

> * Indirection.
> in C when you get a structure pointer you use the '->' operator
> instead of '.' to access members. In D only '.' is allowed. Would
> it be possible to have '->' too as a synomym for '.' ? This is
> just syntaxic sugar and D works well without this but when working
> in D I switch back to my C habits and naturally use '->'.

Don't hold your breath.  It's a conscious design decision for D to avoid 
having many ways of saying the same thing.  Afraid you'll just have to 
learn to not use '->' any more :3

Look on the bright side: now you only need to remember one member access 
operator!

> * JAVA has a base object type too which is used as the base class
> for all other classes. In JAVA the basic object type provides
> synchronization primitives which are quite useful :
> void wait()
> void wait( long timeout )
> void notify()
> void notifyAll()
> Maybe it is already possible to do this in D and I haven't
> understood how. If yes I would be glad to learn how to do so, if
> not maybe these facilities might be added to the D object type ?

I'm not familiar with what these do, but you might want to take a peek 
at the std.thread module.  It's hard to say much else without knowing 
what those methods do (and I have no intention of learning any more Java 
than I already know.)

	-- Daniel



More information about the Digitalmars-d mailing list