* Why I like Ada
@ 1994-12-02 9:44 Richard A. O'Keefe
0 siblings, 0 replies; 20+ messages in thread
From: Richard A. O'Keefe @ 1994-12-02 9:44 UTC (permalink / raw)
When I printed the master copies of my exams for our recently past exams,
they were shifted down on the page. I hadn't changed my (LaTeX) formats.
I didn't know whether to blame LaTeX, the a4wide.sty file (which was now
mysteriously aliased to the a4.sty file for some reason), something else
in the TeX software proper, dvitops, the laserprinter it was sent to, or
some configuration file totally beyond my ken. (I've since been told it
is most likely the latter, but our technical support group having been
downsized to the point where there isn't really enough worker time left
to read problem reports, let alone do anything about them, well, I guess
I'll have to live with the problem for a while.) One thing I thought of
doing was to try another formatter.
There's another formatter which I had long wanted an excuse to try. It
has a lot of nice ideas. The design has been published in the technical
literature; the project in question has been running for ~10 years; it's
actively supported; there's a mailing list for help; and if I FTPed it
the sources would be under *my* control so that nobody else would tamper
with key files.
Of course, the sources are written in C. 43 *.c files. One .h file with
everything in it. 25 000+ lines. Not a very big program. So I edit the
Makefile to tell it where I want things put, and make one change that had
not occurred to the author: I added "-Wall" to the gcc command line. OW!
After about two weeks of spare time tweaking (putting 'static' here 'void'
there, a prototype in the other place, really minor stuff) I finally have
it to the point where there are about 300 lines of output from Lint (that
is a huge improvement, let me tell you).
Fairly obvious point number 1: about 100 of those lines warn that the
ANSI C rules for mixed signed/unsigned arithmetic are DIFFERENT from the
traditional K&R/pcc/UNIX rules for mixed signed/unsigned arithmetic, and
that this may have affected line so-and-so. I have no idea how many of
the warnings are genuine, BUT THE AUTHOR WASN'T SEEING ANY OF THEM because
he wasn't using gcc -Wall or lint.
Interestingly enough, while I was composing this message I decided to try
to do something about those 100 lines. It turns out that *most* of them
are benign (lint warning that "x > 0" is suspicious) but lurking amongst
them are
- several where a group of variables having the same *abstract*
type (count-of <thing>) have been given different *concrete*
types (some int, some unsigned char, some unsigned short &c)
- a couple of places where potentially serious range problems were
lurking (e.g. a count being stored in an unsigned char, with not
even a comment in the code to ensure that there are at most 255
things to count, and some reason to suspect there might be more)
- code that doesn't make sense unless 'int' is exactly 32 bits.
The interesting points here are that
- the C tools (gcc -Wall and lint) *can* find some dangerous things,
- the normal sloppiness of the compiler means that the original
author was encouraged to develop a style in which genuine warnings
(had he ever asked for them) would have been swamped
- I am getting *extremely* nervous about this program; there is
NO connection in the code between the bounds of the many ranges
and the declared concrete types of the variables.
- The Ada approach of having lots of integer subtypes is clearly
the right thing for this program.
Another problem is that gcc -Wall and lint both try to warn you about
variables that may be used without being initialised. Neither of them
is very smart. It turns out that all of the uninitialised variable
warnings are (or may be!) bogus. A fairly typical kind of pattern is
p = ...
while (...) {
x = ...
...
}
... use x ...
which is ok *IF* the loop executes at least one time, typically if the
doubly linked list it traverses is non-empty. As it happens, the code
is full of things that only make sense for non-empty lists, and rather
sparing of comments or assertions that would make me confident. Lint
and gcc haven't found uninitialised variables, but they _have_ found a
maintenance problem.
When I got most of the warnings caused by sloppy style out of the way,
I found that a number of serious and potentially serious problems were
present, and gcc -Wall and lint found them.
(1) There is a really weird statement:
(p = chpt) - 1;
(2) There is a data type with range at least 0..520. The values were
being stored in unsigned char (0..255)! Type a long enough word at
this document processor, and BOOM!
There is very good reason to believe that this is not the only
wrong-size-for-range problem. Unfortunately, because the C code
uses unsigned types, it is "well-defined"; Procrustes rules!
(3) When it read a certain file, it was ALWAYS ignoring the result status
of getc(). When it wrote that file (and others) it was ALWAYS ignoring
the result status of putc() and friends. I have lost enough data due
to stupid utilities thinking that writes can never go wrong to be
really annoyed about this.
Of these,
(1) Ada simply would not allow this.
(2) Ada lets you express the range you want, and have it checked.
(3) Say what you like about TextIO, exception handling is easier
to get right than dozens of if (... == -1) ... tests.
The author of this code was very concerned about quality and debugging.
The code is FULL of debugging tests. If he had been able to write it in
Ada when he started the project, I'd have been saved 2 weeks of spare time,
and I'd have vastly more confidence in the result than I now do.
--
"The complex-type shall be a simple-type." ISO 10206:1991 (Extended Pascal)
Richard A. O'Keefe; http://www.cs.rmit.edu.au/~ok; RMIT Comp.Sci.
^ permalink raw reply [flat|nested] 20+ messages in thread
* Why I like Ada
@ 2004-05-22 0:39 Fionn mac Cuimhaill
2004-05-22 14:11 ` Per Dalgas Jakobsen
0 siblings, 1 reply; 20+ messages in thread
From: Fionn mac Cuimhaill @ 2004-05-22 0:39 UTC (permalink / raw)
I found this in a signature in a message in another newsgroup. I don't
know if Stroustrup actually said this, but it's true and funny.
> "C makes it easy to shoot yourself in the foot;
> C++ makes it harder, but when you do it blows
> your whole leg off."
> - Bjarne Stroustrup
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Why I like Ada
2004-05-22 0:39 Why I like Ada Fionn mac Cuimhaill
@ 2004-05-22 14:11 ` Per Dalgas Jakobsen
2004-05-22 15:23 ` Preben Randhol
2004-05-22 22:01 ` Wes Groleau
0 siblings, 2 replies; 20+ messages in thread
From: Per Dalgas Jakobsen @ 2004-05-22 14:11 UTC (permalink / raw)
> I found this in a signature in a message in another newsgroup. I don't
> know if Stroustrup actually said this, but it's true and funny.
>> "C makes it easy to shoot yourself in the foot;
>> C++ makes it harder, but when you do it blows
>> your whole leg off."
>> - Bjarne Stroustrup
"C++ has its place in the history of programming languages. Just as Caligula
has his place in the history of the Roman Empire." (Robert Firth)
One among many quotes on http://www.sysprog.net/quotes.html
Choose your favorite category on the left side-bar.
Per
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Why I like Ada
2004-05-22 14:11 ` Per Dalgas Jakobsen
@ 2004-05-22 15:23 ` Preben Randhol
2004-05-22 16:27 ` Björn Persson
2004-05-22 22:01 ` Wes Groleau
1 sibling, 1 reply; 20+ messages in thread
From: Preben Randhol @ 2004-05-22 15:23 UTC (permalink / raw)
On 2004-05-22, Per Dalgas Jakobsen <i@hate.spam> wrote:
>> I found this in a signature in a message in another newsgroup. I don't
>> know if Stroustrup actually said this, but it's true and funny.
>>> "C makes it easy to shoot yourself in the foot;
>>> C++ makes it harder, but when you do it blows
>>> your whole leg off."
>>> - Bjarne Stroustrup
>
> "C++ has its place in the history of programming languages. Just as Caligula
> has his place in the history of the Roman Empire." (Robert Firth)
I like this:
Ada
After correctly packing your foot, you attempt to concurrently load
the gun, pull the trigger, scream, and shoot yourself in the foot.
When you try, however, you discover you can't because your foot is
of the wrong type.
http://www.m5p.com/~pravn/foot.html
--
Preben Randhol -------- http://www.pvv.org/~randhol/
() "Violence is the last refuge of the incompetent"
/\ - Isaac Asimov
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Why I like Ada
2004-05-22 15:23 ` Preben Randhol
@ 2004-05-22 16:27 ` Björn Persson
2004-05-25 21:29 ` Robert I. Eachus
0 siblings, 1 reply; 20+ messages in thread
From: Björn Persson @ 2004-05-22 16:27 UTC (permalink / raw)
Preben Randhol wrote:
> Ada
> After correctly packing your foot, you attempt to concurrently load
> the gun, pull the trigger, scream, and shoot yourself in the foot.
> When you try, however, you discover you can't because your foot is
> of the wrong type.
You must of course use Unchecked_Conversion to be able to shoot yourself
in the foot. :-)
--
Björn Persson
jor ers @sv ge.
b n_p son eri nu
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Why I like Ada
2004-05-22 14:11 ` Per Dalgas Jakobsen
2004-05-22 15:23 ` Preben Randhol
@ 2004-05-22 22:01 ` Wes Groleau
1 sibling, 0 replies; 20+ messages in thread
From: Wes Groleau @ 2004-05-22 22:01 UTC (permalink / raw)
Per Dalgas Jakobsen wrote:
> One among many quotes on http://www.sysprog.net/quotes.html
> Choose your favorite category on the left side-bar.
I like this one:
There's an old story about the person who wished his computer
were as easy to use as his telephone. That wish has come true,
since I no longer know how to use my telephone. (Bjarne Stroustrup)
--
Wes Groleau
Is it an on-line compliment to call someone a Net Wit ?
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Why I like Ada
2004-05-22 16:27 ` Björn Persson
@ 2004-05-25 21:29 ` Robert I. Eachus
2004-05-26 7:44 ` Peter Amey
0 siblings, 1 reply; 20+ messages in thread
From: Robert I. Eachus @ 2004-05-25 21:29 UTC (permalink / raw)
Bj�rn Persson wrote:
> Preben Randhol wrote:
>
>> Ada
>> After correctly packing your foot, you attempt to concurrently load
>> the gun, pull the trigger, scream, and shoot yourself in the foot.
>> When you try, however, you discover you can't because your foot is
>> of the wrong type.
>
>
> You must of course use Unchecked_Conversion to be able to shoot yourself
> in the foot. :-)
...and the difficulty of the instantiation for Unchecked_Conversion
might give you a clue. (The formal result type of Unchecked_Conversion
is Target. So if you want to convert to a (local) type Target, you have
to use selected notation... ;-)
--
Robert I. Eachus
"The terrorists rejoice in the killing of the innocent, and have
promised similar violence against Americans, against all free peoples,
and against any Muslims who reject their ideology of murder. Their
barbarism cannot be appeased, and their hatred cannot be satisfied.
There's only one way to deal with terror: We must confront the enemy and
stay on the offensive until these killers are defeated." -- George W. Bush
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Why I like Ada
2004-05-25 21:29 ` Robert I. Eachus
@ 2004-05-26 7:44 ` Peter Amey
2004-05-26 8:18 ` Ludovic Brenta
` (2 more replies)
0 siblings, 3 replies; 20+ messages in thread
From: Peter Amey @ 2004-05-26 7:44 UTC (permalink / raw)
Robert I. Eachus wrote:
> Bj�rn Persson wrote:
>
>> Preben Randhol wrote:
>>
>>> Ada
>>> After correctly packing your foot, you attempt to concurrently load
>>> the gun, pull the trigger, scream, and shoot yourself in the foot.
>>> When you try, however, you discover you can't because your foot is
>>> of the wrong type.
>>
>>
>>
>> You must of course use Unchecked_Conversion to be able to shoot
>> yourself in the foot. :-)
>
>
> ...and the difficulty of the instantiation for Unchecked_Conversion
> might give you a clue. (The formal result type of Unchecked_Conversion
> is Target. So if you want to convert to a (local) type Target, you have
> to use selected notation... ;-)
>
What, as in: "My.Foot"? Yes, that would concentrate the mind a bit.
Peter
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Why I like Ada
2004-05-26 7:44 ` Peter Amey
@ 2004-05-26 8:18 ` Ludovic Brenta
2004-05-26 16:15 ` Martin Krischik
2004-05-26 15:30 ` Wes Groleau
2004-06-01 3:57 ` Robert I. Eachus
2 siblings, 1 reply; 20+ messages in thread
From: Ludovic Brenta @ 2004-05-26 8:18 UTC (permalink / raw)
Here is another quote that got me smiling lately:
"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are, by
definition, not smart enough to debug it." - Brian W. Kernighan
--
Ludovic Brenta.
--
Use our news server 'news.foorum.com' from anywhere.
More details at: http://nnrpinfo.go.foorum.com/
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Why I like Ada
2004-05-26 7:44 ` Peter Amey
2004-05-26 8:18 ` Ludovic Brenta
@ 2004-05-26 15:30 ` Wes Groleau
2004-06-01 3:57 ` Robert I. Eachus
2 siblings, 0 replies; 20+ messages in thread
From: Wes Groleau @ 2004-05-26 15:30 UTC (permalink / raw)
Peter Amey wrote:
>> Unchecked_Conversion is Target. So if you want to convert to a
>> (local) type Target, you have to use selected notation... ;-)
>
> What, as in: "My.Foot"? Yes, that would concentrate the mind a bit.
Indeed. Such absurdly non-intuitive syntax.
Obviously better would be
Foot ( My )
--
Wes Groleau
A UNIX signature isn't a return address, it's the ASCII equivalent
of a black velvet clown painting. It's a rectangle of carets
surrounding a quote from a literary giant of weeniedom like
Heinlein or Dr. Who.
-- Chris Maeda
Ha, ha! Dr. ... Who is Chris Maeda?
-- Wes Groleau
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Why I like Ada
2004-05-26 8:18 ` Ludovic Brenta
@ 2004-05-26 16:15 ` Martin Krischik
2004-05-26 19:33 ` David Starner
0 siblings, 1 reply; 20+ messages in thread
From: Martin Krischik @ 2004-05-26 16:15 UTC (permalink / raw)
Ludovic Brenta wrote:
>
> Here is another quote that got me smiling lately:
>
> "Debugging is twice as hard as writing the code in the first place.
> Therefore, if you write the code as cleverly as possible, you are, by
> definition, not smart enough to debug it." - Brian W. Kernighan
If you program in C/C++ that is indeed true. How glad I am that I found out
about Ada.
With Regards
--
mailto://krischik@users.sourceforge.net
http://www.ada.krischik.com
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Why I like Ada
2004-05-26 16:15 ` Martin Krischik
@ 2004-05-26 19:33 ` David Starner
2004-05-30 18:06 ` Richard Riehle
0 siblings, 1 reply; 20+ messages in thread
From: David Starner @ 2004-05-26 19:33 UTC (permalink / raw)
On Wed, 26 May 2004 18:15:53 +0200, Martin Krischik wrote:
> Ludovic Brenta wrote:
>
>>
>> Here is another quote that got me smiling lately:
>>
>> "Debugging is twice as hard as writing the code in the first place.
>> Therefore, if you write the code as cleverly as possible, you are, by
>> definition, not smart enough to debug it." - Brian W. Kernighan
>
> If you program in C/C++ that is indeed true. How glad I am that I found out
> about Ada.
Why do you think it's a function of programming language? It may be at
a different level, but you can replace divisions with bit-twiddling,
structured code with hyperoptimized gotos, or manually inline code in
Ada just like C.
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Why I like Ada
2004-05-26 19:33 ` David Starner
@ 2004-05-30 18:06 ` Richard Riehle
2004-05-30 18:17 ` Randy Brukardt
[not found] ` <inpkb0d57uiaf6970hk0ctj09orni4piea@4ax.com>
0 siblings, 2 replies; 20+ messages in thread
From: Richard Riehle @ 2004-05-30 18:06 UTC (permalink / raw)
"David Starner" <dvdeug@email.ro> wrote in message
news:pan.2004.05.26.19.11.04.359100@email.ro...
... in response to a conversation about debugging C versus Ada,
> Why do you think it's a function of programming language? It may be at
> a different level, but you can replace divisions with bit-twiddling,
> structured code with hyperoptimized gotos, or manually inline code in
> Ada just like C.
I don't know how much Ada, C, or C++ you have written, but I am going to
assume you have written quite a lot of each.
Back in the 1908's, when I first started coding Ada, I found myself
constantly
checking up on myself by resorting to the debugger, pretty much the same
thing
I did with my C code. In time, I realized that I needed the debugger less
and
less with Ada. This does not mean it is never necessary to use the
debugger.
In fact, I still like to use the debugger as an informational tool (what
kind of
code is being generated) rather than an error-correction tool.
With C++, I find myself going into debug mode much more than with Ada.
This is especially true when I am trying to figure out what is going on with
a misbehaving C++ program written by someone else. Perhaps this is
because I am more comfortable with Ada than with C++. Even so, when
I do need to debug Ada code, it is much easier, for me, than debugging C++
code.
So, for me, language does matter.
I am more and more becoming concerned with the notion of risk in software
engineering. The more I compare the relative risks of programming
languages,
the more I realize that Ada, for me, is not as risk-laden as most of the
alternatives.
That is, it seems easier to create risk-free code in Ada than in C or C++,
while
achieving the same level of performance and flexibility.
Of course, your mileage may vary.
Richard Riehle
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Why I like Ada
2004-05-30 18:06 ` Richard Riehle
@ 2004-05-30 18:17 ` Randy Brukardt
2004-05-30 19:09 ` Adrian Knoth
2004-05-31 13:27 ` Björn Persson
[not found] ` <inpkb0d57uiaf6970hk0ctj09orni4piea@4ax.com>
1 sibling, 2 replies; 20+ messages in thread
From: Randy Brukardt @ 2004-05-30 18:17 UTC (permalink / raw)
"Richard Riehle" <adaworks@earthlink.net> wrote in message
news:uopuc.17041$be.15411@newsread2.news.pas.earthlink.net...
> Back in the 1908's, when I first started coding Ada, I found myself
constantly...
No wonder Ada doesn't get any use -- it's too old! :-)
I'm pretty sure that neither Ada nor Richard existed in the 1908's! :-)
Randy.
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Why I like Ada
2004-05-30 18:17 ` Randy Brukardt
@ 2004-05-30 19:09 ` Adrian Knoth
2004-05-31 13:27 ` Björn Persson
1 sibling, 0 replies; 20+ messages in thread
From: Adrian Knoth @ 2004-05-30 19:09 UTC (permalink / raw)
Randy Brukardt <randy@rrsoftware.com> wrote:
> "Richard Riehle" <adaworks@earthlink.net> wrote in message
>> Back in the 1908's, when I first started coding Ada, I found myself
>> constantly...
> I'm pretty sure that neither Ada nor Richard existed in the 1908's! :-)
Don't blame him, he's using X-Newsreader: Microsoft Outlook Express,
probably the version which is not Y2k-compliant. ;)
--
mail: adi@thur.de http://adi.thur.de PGP: v2-key via keyserver
Die schmutzige Luft erspart den Einbrechern das Schmierestehen.
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Why I like Ada
[not found] ` <inpkb0d57uiaf6970hk0ctj09orni4piea@4ax.com>
@ 2004-05-31 2:07 ` Richard Riehle
0 siblings, 0 replies; 20+ messages in thread
From: Richard Riehle @ 2004-05-31 2:07 UTC (permalink / raw)
"Dennis Lee Bieber" <wlfraed@ix.netcom.com> wrote in message
news:inpkb0d57uiaf6970hk0ctj09orni4piea@4ax.com...
> On Sun, 30 May 2004 18:06:18 GMT, "Richard Riehle"
> <adaworks@earthlink.net> declaimed the following in comp.lang.ada:
>
> >
> > Back in the 1908's, when I first started coding Ada, I found myself
>
> <snort><snicker>Are you sure you weren't dating her? <G>
> Granted, she'd have to be in her 90s by then...
>
> Sorry -- I know you meant 1980s, but the transposition makes for such an
> image...
Dennis, there are those who know me well enough to wonder whether
I might not have actually meant 1908, given my seeming antiquity.
However, notwithstanding that antiquity, I did not actually begin writing
programs in the Ada language until the 1980's.
My 1908 programming was limited to filing sprockets for cuckoo clocks. :-)
Richard
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Why I like Ada
2004-05-30 18:17 ` Randy Brukardt
2004-05-30 19:09 ` Adrian Knoth
@ 2004-05-31 13:27 ` Björn Persson
1 sibling, 0 replies; 20+ messages in thread
From: Björn Persson @ 2004-05-31 13:27 UTC (permalink / raw)
Randy Brukardt wrote:
> I'm pretty sure that neither Ada nor Richard existed in the 1908's! :-)
I don't know about Richard, but Ada died in 1852 so you're right about her.
--
Björn Persson
jor ers @sv ge.
b n_p son eri nu
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Why I like Ada
2004-05-26 7:44 ` Peter Amey
2004-05-26 8:18 ` Ludovic Brenta
2004-05-26 15:30 ` Wes Groleau
@ 2004-06-01 3:57 ` Robert I. Eachus
2004-06-02 1:48 ` Jeffrey Carter
2 siblings, 1 reply; 20+ messages in thread
From: Robert I. Eachus @ 2004-06-01 3:57 UTC (permalink / raw)
Peter Amey wrote:
>> ...and the difficulty of the instantiation for Unchecked_Conversion
>> might give you a clue. (The formal result type of
>> Unchecked_Conversion is Target. So if you want to convert to a
>> (local) type Target, you have to use selected notation... ;-)
>>
>
> What, as in: "My.Foot"? Yes, that would concentrate the mind a bit.
No, you could "get away" with
function To_Target is new Ada.Unchecked_Conversion
(Source => Body_Part_Type, Target => Gun.Target)
I was commenting that you need to use selected notation for the type
Target. Some Ada terminology is titillating, but in this case it is
just scary. Hmmm. In fact...
with Ada.Unchecked_Conversion;
procedure Shoot_Foot is
type Target is new Character; -- just so this test will compile.
type Weapon is (M15A3, AK47, M1911A1);
type Condition is (Healthy, Damaged, Missing);
type Body_Part is record
State: Condition := Healthy;
-- ...
end record;
type Person_Body is record
Head, Neck, Left_Shoulder, Right_Shoulder, Chest, Torso,
Left_Arm, Right_Arm, Left_Hand, Right_Hand, Left_Leg,
Right_Leg, Left_Knee, Right_Knee, Left_Foot, Right_Foot:
Body_Part;
end record;
procedure Shoot(What: in Target; Gun: in Weapon)
is begin null; end; --TBD.
function To_Target is new Ada.Unchecked_Conversion
(Source => Body_Part, Target => Target);
Me: Person_Body;
begin
Shoot(To_Target(Me.Left_Foot), AK47);
end Shoot_Foot;
I'll be darned! GNAT took that Target => Target. I was expecting it to
require the second Target to use selected notation. Its midnight, so
I'll wait 'til tomorrow to figure out if that is really a bug.
Of course, in reality, Target would be an in out parameter to Shoot, or
an access value denoting the actual Target. (Same for gun, that's why
Shoot is TBD. ;-)
--
Robert I. Eachus
"The terrorists rejoice in the killing of the innocent, and have
promised similar violence against Americans, against all free peoples,
and against any Muslims who reject their ideology of murder. Their
barbarism cannot be appeased, and their hatred cannot be satisfied.
There's only one way to deal with terror: We must confront the enemy and
stay on the offensive until these killers are defeated." -- George W. Bush
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Why I like Ada
2004-06-01 3:57 ` Robert I. Eachus
@ 2004-06-02 1:48 ` Jeffrey Carter
2004-06-02 5:13 ` Robert I. Eachus
0 siblings, 1 reply; 20+ messages in thread
From: Jeffrey Carter @ 2004-06-02 1:48 UTC (permalink / raw)
Robert I. Eachus wrote:
> I'll be darned! GNAT took that Target => Target. I was expecting it to
> require the second Target to use selected notation. Its midnight, so
> I'll wait 'til tomorrow to figure out if that is really a bug.
IANALL (and I know you are), but I'm pretty sure it's not a bug. My
understanding is that there is never a conflict between a formal
parameter name and an actual parameter name in named notation.
--
Jeff Carter
"Now look, Col. Batguano, if that really is your name."
Dr. Strangelove
31
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Why I like Ada
2004-06-02 1:48 ` Jeffrey Carter
@ 2004-06-02 5:13 ` Robert I. Eachus
0 siblings, 0 replies; 20+ messages in thread
From: Robert I. Eachus @ 2004-06-02 5:13 UTC (permalink / raw)
Jeffrey Carter wrote:
> Robert I. Eachus wrote:
>
>> I'll be darned! GNAT took that Target => Target. I was expecting it to
>> require the second Target to use selected notation. Its midnight, so
>> I'll wait 'til tomorrow to figure out if that is really a bug.
>
>
> IANALL (and I know you are), but I'm pretty sure it's not a bug. My
> understanding is that there is never a conflict between a formal
> parameter name and an actual parameter name in named notation.
I realized a while ago that after midnight IANALL either. ;-) And yes,
it is after midnight when I am typing this. But I discussed the issue
with Bob Duff earlier, when we were both language lawyers. You are
correct, the visibility of the first Target is only on the left side of
the arrow. Other than that, the direct scope of a parameter is inside
the declaration of the subprogram or generic.
However, from a software engineering point of view, if not a bug it is a
pretty dodgy usage. Puns have no place in real code.
--
Robert I. Eachus
"The terrorists rejoice in the killing of the innocent, and have
promised similar violence against Americans, against all free peoples,
and against any Muslims who reject their ideology of murder. Their
barbarism cannot be appeased, and their hatred cannot be satisfied.
There's only one way to deal with terror: We must confront the enemy and
stay on the offensive until these killers are defeated." -- George W. Bush
^ permalink raw reply [flat|nested] 20+ messages in thread
end of thread, other threads:[~2004-06-02 5:13 UTC | newest]
Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-05-22 0:39 Why I like Ada Fionn mac Cuimhaill
2004-05-22 14:11 ` Per Dalgas Jakobsen
2004-05-22 15:23 ` Preben Randhol
2004-05-22 16:27 ` Björn Persson
2004-05-25 21:29 ` Robert I. Eachus
2004-05-26 7:44 ` Peter Amey
2004-05-26 8:18 ` Ludovic Brenta
2004-05-26 16:15 ` Martin Krischik
2004-05-26 19:33 ` David Starner
2004-05-30 18:06 ` Richard Riehle
2004-05-30 18:17 ` Randy Brukardt
2004-05-30 19:09 ` Adrian Knoth
2004-05-31 13:27 ` Björn Persson
[not found] ` <inpkb0d57uiaf6970hk0ctj09orni4piea@4ax.com>
2004-05-31 2:07 ` Richard Riehle
2004-05-26 15:30 ` Wes Groleau
2004-06-01 3:57 ` Robert I. Eachus
2004-06-02 1:48 ` Jeffrey Carter
2004-06-02 5:13 ` Robert I. Eachus
2004-05-22 22:01 ` Wes Groleau
-- strict thread matches above, loose matches on Subject: below --
1994-12-02 9:44 Richard A. O'Keefe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox