typedefs are useless
Peter C. Chapin
pchapin at sover.net
Tue Dec 4 04:29:11 PST 2007
BLS wrote:
> IMO, in this case ADA is slicker than D.
> I remember that f.i.
> type Natural is range 0..255
> is quit often in use.
Actually that's
subtype Natural is Integer range 0 .. Integer'Last;
The values in the type are all the non-negative integers. Also it's a
subtype so it can be freely mixed with its parent type (Integer).
However, a run time check will be added when necessary to verify the
range constraint.
Sorry about the off topic post. I just felt the need to clarify that
point. :-)
Peter
More information about the Digitalmars-d
mailing list