Re: New Book: The School of Niklaus Wirth

vbdis@aol.com (VBDis)
19 Nov 2000 20:29:05 -0500

          From comp.compilers

Related articles
[9 earlier articles]
Re: New Book: The School of Niklaus Wirth guerby@acm.org (Laurent Guerby) (2000-11-14)
Re: New Book: The School of Niklaus Wirth vbdis@aol.com (2000-11-14)
Re: New Book: The School of Niklaus Wirth genew@shuswap.net (2000-11-14)
Re: New Book: The School of Niklaus Wirth gdemont@my-deja.com (2000-11-16)
Re: New Book: The School of Niklaus Wirth jerrold.leichter@smarts.com (Jerry Leichter) (2000-11-17)
Re: New Book: The School of Niklaus Wirth fjh@cs.mu.OZ.AU (2000-11-19)
Re: New Book: The School of Niklaus Wirth vbdis@aol.com (2000-11-19)
Re: New Book: The School of Niklaus Wirth jerrold.leichter@smarts.com (Jerry Leichter) (2000-11-21)
Re: New Book: The School of Niklaus Wirth gdemont@my-deja.com (2000-11-22)
Re: types and subranges, was New Book: The School of Niklaus Wirth joachim_d@gmx.de (Joachim Durchholz) (2000-11-25)
Re: New Book: The School of Niklaus Wirth nr@labrador.eecs.harvard.edu (2000-11-30)
| List of all articles for this month |

From: vbdis@aol.com (VBDis)
Newsgroups: comp.compilers
Date: 19 Nov 2000 20:29:05 -0500
Organization: AOL Bertelsmann Online GmbH & Co. KG http://www.germany.aol.com
References: 00-11-120
Keywords: types
Posted-Date: 19 Nov 2000 20:29:05 EST

gdemont@my-deja.com schreibt:
>A subrange is a thing, the kind of animal containing the value is
>another.


IMO subranges with explicit bounds are the most portable kind of data types.
The lower bound indicates whether the value is signed or unsigned, and the
compiler can choose the best fitting data type for the requested precision.
Delphi internally describes all integral data types by subranges, including the
predefined data types.


It would be really helpful to the programmers, if every integral data type were
described by the according subrange. Then I had not to guess every time, how
many bytes a SmallInt or ShortInt has :-(


>A 0..255 subrange of a 32-bit type is not the same as a byte.


A subrange doesn't require or imply any base type.


Also "a 32-bit type" is not a very precise description, it might be signed or
unsigned. A "byte" also has no fixed number of bits, though it's usually
associated with 8 bits.


DoDi


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.