compiler intrinsic all() returns the set consisting of all members of a given type
Original Reporter info from Mantis: kays @KaiBurghardt
-
Reporter name: Kai Burghardt
Original Reporter info from Mantis: kays @KaiBurghardt
- Reporter name: Kai Burghardt
Description:
all(someOrdinalType) shall result/expand to [low(someOrdinalType)..high(someOrdinalType)], if someOrdinalType is continuous and within the ranges of our currently available set data types
Additional information:
Wirth originally proposed this syntax http://www.pascal-central.com/docs/pascal1973.pdf (PDF page 43, bottom). I can't find anything alike in the more recent ISO standards, that would virtually supersede that suggestion.
While all(boolean) or all(byte) are quite uninteresting, I think this feature is really cool in conjunction with enumerated types, or small enough number ranges.
I guess it is easy to implement, since the syntax [low(T)..high(T)] already exists and works without further ado. However, if an an enumerated type has been defined with explicit indices, that are not subsequent, it will return a different result than intended by all(myEnumeration).
Mantis conversion info:
- Mantis ID: 34953
- OS: GNU/Linux
- OS Build: 4.2.0
- Build: 3.0.4+dfsg-11 [2017/12/30]
- Platform: x86_64
- Version: 3.0.4