Previous mail
Next mail
Unformatted/full headers
Overview 10 days
Subject
Date
Thread
Author
From: Frank D. Engel, Jr.
Subject: [GPC]: daily digest (#613)
Date: 1 Feb 2005, 14:50:00
Hash: SHA1
On Feb 1, 2005, at 1:59 PM, Frank Heckenbach wrote:
> issues. Since Ada's main goal is to be strongly typed and safe at
> runtime, I can't really imagine they added things such as unchecked
> type-casts, "absolute" variables, assembler statements and machine
> code inlines, low-level memory access (FillChar, Move), misusing
> constants as variables, confusion between pointers and arrays and
> sometimes single elements and arrays etc., to name just some of the
> most problematic ones.
Correct, those are not features of Ada. Ada *does* have features like
AND THEN and OR ELSE (like GPC's AND_THEN, OR_ELSE), and a number of
really cool features that are not even part of GPC to my knowledge.
Then again, GPC has some things (like SETs) which Ada does not...
Ada has the notion of a "range", which is a sequence of values with a
starting point and an ending point. In other words, a range could be
1..5, 'a'..'z', etc., but it cannot contain disjoint values as can one
of Pascal's SETs -- ['A', '5'..'7'] cannot be reproduced easily in Ada.
However, you can do some interesting things with the ranges:
for i in 1..5 loop -- standard Ada for loop header
for i in Integer'Range -- another way to look at it, hmm...
Ada *does* have type casts, but they are neither 'unchecked' nor
arbitrary. Additionally, you can't even directly perform mathematical
operations between integers and reals without casting them. Ada is
very picky, but it certainly does make it much more difficult to
accidentally leave many kinds of "stupid" bugs in your code.
Off-by-one is still possible, obviously (although Ada can even catch
some instances of this, where types are well-defined and the off-by-one
results in a range check exception), and some other things...
Ada also supports exceptions, and a somewhat strict variation on
inheritance using extensible records:
type oldRec is
record
oldField : Integer;
end record;
type newRec is new oldRec with
record
newField : Integer;
end record;
(newRec will have two fields: oldField and newField).
Disclaimer: I did not run the above code through an Ada compiler, so it
is quite possible there were some errors in that code... but I'm sure
it's pretty close.
- -----------------------------------------------------------
Frank D. Engel, Jr. <fde101@fjrhome.net>
$ ln -s /usr/share/kjvbible /usr/manual
$ true | cat /usr/manual | grep "John 3:16"
John 3:16 For God so loved the world, that he gave his only begotten
Son, that whosoever believeth in him should not perish, but have
everlasting life.
$
___________________________________________________________
$0 Web Hosting with up to 120MB web space, 1000 MB Transfer
10 Personalized POP and Web E-mail Accounts, and much more.
Signup at www.doteasy.com
Previous mail
Next mail
Unformatted/full headers
Overview 10 days
Subject
Date
Thread
Author
| Author | Subject | Date |
|---|---|---|
| Frank Heckenbach | [GPC]: daily digest (#613) | 1 Feb 2005, 21:49:48 |
Note: This page contains information that does not originate from the owner of this web site, but from the authors of the mails archived. The owner of this web site is not responsible for the content of such information. Any use of that infomation requires the consent of the respective author.
Where WWW addresses (URLs) in the mails archived are marked as hyperlinks, this is only for the comfort of the reader. The content of the web pages linked to like this does not necessarily reflect the opinion of the owner of this web site or of the authors of the mails archived. The owner of this web site is not responsible for the content of such web pages. Those pages are explicitly not to be considered as part of the content of this page, but merely as references.
This page was created by Crystal 0.999 (Linux 2.4.27/i686).