comp.lang.ada
 help / color / mirror / Atom feed
From: Robert Dewar <robert_dewar@my-dejanews.com>
Subject: Re: scope and/or parameters (beginner)
Date: 1999/04/15
Date: 1999-04-15T00:00:00+00:00	[thread overview]
Message-ID: <7f52r9$n7q$1@nnrp1.dejanews.com> (raw)
In-Reply-To: 37149AE9.883147B6@prolifics.com

In article <37149AE9.883147B6@prolifics.com>,
  Hyman Rosen <hymie@prolifics.com> wrote:
> Robert Dewar wrote:
>
> Correct. A C programmer would, of course, simply declare
> the parameter as being 'const', then insert the test
> exactly as you did in Ada.
>
> Hmph. I'm surprised that you, of all people, are so
> parochial. You usually aren't.

The "of course" here is mighty forced :-)

First, I have never *ever* seen C programmers routinely
write prototypes with const in them, as in

   int max (const int a, const int b) {

so to claim that it is standard practice, as implied by
your "of course" is really stretching things.

Second, please note that in C, if you *do* declare things
this way, the effect of assigning to the const object is
"undefined" according to the ANSI C standard, not illegal
but undefined!

Your compiler may be kind enough to give you a warning,
gcc does, but it is not even required to do this.

So (a) I think the claim that C programmers would of course
use the const keyword in this context is completely bogus
and (b) even if they do, it does not mean that the compiler
will reject attempts to assign to the "const" object.

perhaps the abbreviation of constant to const is best
interpreted as meaning that it is sort of constant, but
not very :-) :-)

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    




  parent reply	other threads:[~1999-04-15  0:00 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-04-02  0:00 scope and/or parameters (beginner) fluffy_pink
1999-04-03  0:00 ` Matthew Heaney
1999-04-05  0:00 ` Corey Ashford
1999-04-05  0:00   ` fluffy_doo
1999-04-06  0:00     ` Matthew Heaney
1999-04-08  0:00     ` czgrr
1999-04-10  0:00       ` fluffy_puff
1999-04-12  0:00       ` dennison
1999-04-13  0:00         ` czgrr
1999-04-13  0:00           ` Robert Dewar
1999-04-14  0:00             ` czgrr
1999-04-14  0:00               ` dennison
1999-04-14  0:00               ` Robert Dewar
1999-04-15  0:00                 ` czgrr
1999-04-15  0:00                   ` Robert Dewar
1999-04-13  0:00         ` Robert Dewar
1999-04-13  0:00     ` Robert A Duff
1999-04-14  0:00       ` Robert Dewar
1999-04-14  0:00         ` Hyman Rosen
1999-04-14  0:00           ` dennison
1999-04-14  0:00             ` Hyman Rosen
1999-04-14  0:00               ` dennison
1999-04-14  0:00                 ` Hyman Rosen
1999-04-15  0:00                   ` dennison
1999-04-15  0:00                     ` Robert Dewar
1999-04-15  0:00                       ` dennison
1999-04-15  0:00                       ` Hyman Rosen
1999-04-15  0:00           ` Robert Dewar [this message]
1999-04-15  0:00             ` Hyman Rosen
1999-04-15  0:00               ` Robert Dewar
1999-04-15  0:00                 ` Hyman Rosen
1999-04-16  0:00               ` Rakesh Malhotra
1999-04-15  0:00       ` fluffy_dong
1999-04-15  0:00         ` Robert Dewar
1999-04-15  0:00           ` dennison
1999-04-15  0:00             ` fluffy_dong
1999-04-16  0:00               ` Robert Dewar
1999-04-16  0:00                 ` Fraser Wilson
1999-04-16  0:00                   ` Gautier.DeMontmollin
1999-04-20  0:00                     ` Nick Roberts
1999-04-21  0:00                     ` fraser
1999-04-22  0:00               ` Robert A Duff
1999-04-22  0:00                 ` Larry Kilgallen
1999-04-16  0:00         ` Samuel Mize
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox