On Sun, Oct 10, 2010 at 03:40, Denis <[email protected]> wrote: > I believe in D one should be able to write a RangedInt(int lowerBound, > int upperBound) type that would make sure it contains value in the > range specified (that would require runtime checks, but I think that's > acceptable, those check can be disabled in release). Could be suitable > for DayOfWeek, Month, etc.
What about posting that as a [challenge] on the main D newsgroup? It's also interesting for floating point values between 0 and 1, for probabilities or whatever field that's normalized. Heck, even for defining letters, digits, etc. alias Ranged!(char, 'a','z') letters; alias Ranged!(char, 'A', 'Z') Letters; alias Ranged!(char, '0', '9') digits; _______________________________________________ phobos mailing list [email protected] http://lists.puremagic.com/mailman/listinfo/phobos
