Hallo Michael,
Du schriebst am Mon, 11 Nov 2013 10:00:17 +0100:
> On 11/08/2013 11:26 PM, Sieghard wrote:
> >
> > TYPE
> > MonthDay = 1..31;
> > WeekDay = 1..7;
> > CharBits = 5..9; { for serial interfaces }
> >
> > Not useful?
>
> IMHO Only really useful if you go on
>
> Type WorkingHours = Array [MonthDay] of Integer;
>
> or similar.
Well, similar, I'd think.
But anyway, such use is _really_ the _intended_ method of using these
constructs. They're _not_ there to ease the implementation of the compiler
or typing in the program code, but to show the intentions of the
implementor and the interactions of data. And that's also why these
subrange types should _NOT_ normally be type compatible to each other or
even their base type - any such "mapping" would _have_ to be specified
explicitely by a cast to clearly show the breaking of the type integrity.
And that's not normally a very confining restriction, as such integrity
breaks aren't all that common, in fact, if the types are constructed
carefully, such breaks are rare exceptions and barely ever needed.
--
--
(Weitergabe von Adressdaten, Telefonnummern u.ä. ohne Zustimmung
nicht gestattet, ebenso Zusendung von Werbung oder ähnlichem)
-----------------------------------------------------------
Mit freundlichen Grüßen, S. Schicktanz
-----------------------------------------------------------
------------------------------------------------------------------------------
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
_______________________________________________
mseide-msegui-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk