Converting Java code to D

Russel Winder via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Apr 20 10:45:24 PDT 2015


On Mon, 2015-04-20 at 17:28 +0000, John Colvin via Digitalmars-d-learn wrote:
> […]
> 
> True, the constructor doesn't really add anything here.
> 
> To be honest, the combination of enumeration and runtime 
> variables in the Java code seems like a rubbish design, but 
> perhaps there's a good reason for it that I'm not aware of.

It's "Type Safe Enum" from Java and C++:

http://docs.oracle.com/javase/8/docs/technotes/guides/language/enums.ht
ml
http://www.javapractices.com/topic/TopicAction.do?Id=1
http://en.wikibooks.org/wiki/More_C%2B%2B_Idioms/Type_Safe_Enum

-- 
Russel.
=============================================================================
Dr Russel Winder      t: +44 20 7585 2200   voip: sip:russel.winder at ekiga.net
41 Buckmaster Road    m: +44 7770 465 077   xmpp: russel at winder.org.uk
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: This is a digitally signed message part
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20150420/8eeab349/attachment.sig>


More information about the Digitalmars-d-learn mailing list