Positive

Peter C. Chapin pcc482719 at gmail.com
Sun Oct 5 04:30:25 PDT 2008


Andrei Alexandrescu wrote:

> Rats. I was thinking positive means >= 0 and strictly positive means >
> 0. According to Wikipedia, positive really means strictly positive and
> the longer-to-type NonNegative should be used instead :o|. For such a
> simple concept, a short and sweet name is pivotal. If there are any
> ideas for a better choice, please make them known.

Ada supports the ability to create new types from the primitive numeric
types by adding range constraints to the primitive. The Ada community
finds this useful and would appreciate the sort of feature you are
talking about. In Ada there are even two predefined subtypes of Integer

	subtype Positive is Integer range 1 .. Integer'Last;
	subtype Natural is Integer range 0 .. Integer'Last;

So for non-negative integers... what about "natural"?

Peter



More information about the Digitalmars-d mailing list