Related articles |
---|
Re: Re: New Book: The School of Niklaus Wirth ollanes@pobox.com (Orlando Llanes) (2000-11-05) |
Re: New Book: The School of Niklaus Wirth djg@argus.vki.bke.hu (Gabor DEAK JAHN) (2000-11-11) |
Re: New Book: The School of Niklaus Wirth gdemont@my-deja.com (2000-11-16) |
SV: Re: New Book: The School of Niklaus Wirth mikael@pobox.com (Mikael Lyngvig) (2000-11-17) |
Re: SV: Re: New Book: The School of Niklaus Wirth guerby@acm.org (Laurent Guerby) (2000-11-19) |
From: | "Mikael Lyngvig" <mikael@pobox.com> |
Newsgroups: | comp.compilers |
Date: | 17 Nov 2000 23:44:06 -0500 |
Organization: | Compilers Central |
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:
uint Index;
...
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;
begin
...
Index = Index + 1
...
end
-- Mikael
Return to the
comp.compilers page.
Search the
comp.compilers archives again.