|Re: Re: New Book: The School of Niklaus Wirth firstname.lastname@example.org (Orlando Llanes) (2000-11-05)|
|Re: New Book: The School of Niklaus Wirth email@example.com (Gabor DEAK JAHN) (2000-11-11)|
|Re: New Book: The School of Niklaus Wirth firstname.lastname@example.org (2000-11-16)|
|SV: Re: New Book: The School of Niklaus Wirth email@example.com (Mikael Lyngvig) (2000-11-17)|
|Re: SV: Re: New Book: The School of Niklaus Wirth firstname.lastname@example.org (Laurent Guerby) (2000-11-19)|
|From:||"Mikael Lyngvig" <email@example.com>|
|Date:||17 Nov 2000 23:44:06 -0500|
|References:||00-11-046 00-11-082 00-11-120|
|Keywords:||Pascal, design, Ada|
|Posted-Date:||17 Nov 2000 23:44:06 EST|
> The real "serious" descendent of Pascal, Ada, brings signed and
> unsigned types for all these lengths...
Actually, Ada83 did not define an unsigned type, which made the
language a pain to use for systems oriented tasks such as linkers,
etc. An unsigned type was added to Ada9x, however.
Ada9x also added another "basic integer" type - the modulo type, which
is a kind of "unsigned wrap-around type", which is an integer that
silently wraps around when it reaches the modulo value (without
throwing an exception).
So instead of writing the code shown below in C:
Index += 1;
Index %= TableSize;
You'd write the code shown below in Ada95 (or something like it; I
haven't looked at Ada for a few years):
Index is mod TableSize;
Index = Index + 1
Return to the
Search the comp.compilers archives again.