comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Constant as anonymous functions : the outer space beast is back
Date: Fri, 5 Feb 2010 15:51:33 -0600
Date: 2010-02-05T15:51:33-06:00	[thread overview]
Message-ID: <hki3t8$ucr$1@munin.nbi.dk> (raw)
In-Reply-To: 454c900f-85ed-4a40-ad13-a5b432261b99@c29g2000yqd.googlegroups.com

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2272 bytes --]

"Hibou57 (Yannick Duch�ne)" <yannick_duchene@yahoo.fr> wrote in message 
news:454c900f-85ed-4a40-ad13-a5b432261b99@c29g2000yqd.googlegroups.com...
>On 30 jan, 09:45, AdaMagica <christoph.gr...@eurocopter.com> wrote:
>> And even if you make Count a function (overloadable), this example
>> code is still illegal in Ada as is - and that's a good thing.
>>
>> package P is
>> function Count return Float;
>> end P;
>
>Yes, because the Count loop variant still hide the one from P.

Right, but that wouldn't be true in your suggested semantics, as the Count 
object would be overloadable. Even if you restricted that only to constants 
(of which Count is one).

It's clear that you haven't thought this through very well. Adam notes that 
you could just change the behavior of constants declared with "constant", 
but that makes no sense -- a renames of a constant object does not include 
the keyword constant. So such a "simple" rule wouldn't work.

Moreover, it doesn't make sense to treat constants and variables 
differently. The only sane choice is to change the behavior of *all* 
objects -- there is nothing that special about constants. Treating constants 
and variables differently would introduce a major maintenance hazard. The 
current principle (and one that ever programmer would expect) is that 
changing a declaration from constant to variable (or the reverse) only 
changes whether or not it can be written. Otherwise it ought to behave 
identically. Making the visibility rules wildly different for constants and 
variables would not have that effect (it's quite likely changing a constant 
to a variable would make some if it's uses illegal using your rule).

And it is bizarre to say that you are trying to increase consistency and 
then try to treat things syntactically declared one way from equivalent 
things declared in another way. How that could *increase* consistency is 
beyond my comprehension.

I had seriously proposed making objects overloadable declarations for use 
clause purposes only (mainly to decrease the maintenance hazard inherent in 
use clauses - which is really what you are complaining about), but that idea 
didn't get any traction. So nothing is going to change in this area.

                                 Randy.








  reply	other threads:[~2010-02-05 21:51 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-27  1:57 Constant as anonymous functions : the outer space beast is back Hibou57 (Yannick Duchêne)
2010-01-27  2:12 ` Robert A Duff
2010-01-27  2:15   ` Hibou57 (Yannick Duchêne)
2010-01-30  2:42   ` Randy Brukardt
2010-01-30  8:45     ` AdaMagica
2010-02-02 19:34       ` Hibou57 (Yannick Duchêne)
2010-02-05 21:51         ` Randy Brukardt [this message]
2010-02-05 22:41           ` Hibou57 (Yannick Duchêne)
2010-02-06  9:34             ` Dmitry A. Kazakov
2010-02-07 16:22         ` Robert A Duff
2010-02-09  0:22           ` Randy Brukardt
2010-02-02 19:36     ` Hibou57 (Yannick Duchêne)
2010-02-02 21:26     ` Adam Beneschan
2010-02-02 21:47       ` Hibou57 (Yannick Duchêne)
2010-02-03  0:55         ` Adam Beneschan
replies disabled

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