New Issue: Range BoundedRangeType verbosity

17126, “vasslitvinov”, “Range BoundedRangeType verbosity”, “2021-02-09T06:45:35Z”

Currently bounded-ness of a range is given by an enum:

enum BoundedRangeType { bounded, boundedLow, boundedHigh, boundedNone };

Its uses in creating ranges are often heavy-weight i.e. lengthy, ex.:

var r: range(boundedType=BoundedRangeType.boundedLow);

How can we make it more attractive to users? Possible directions:

  • use BoundedRangeType;
  • factory functions
  • shorten the name of the type or the individual enums?
  • provide easier-to-use initializers, ex.:
var r: range(boundedHigh=false);  // boundedLow, boundedHigh are optional args defaulting to true
var r: range(unbounded=true);