From: "Hibou57 (Yannick Duchêne)" <yannick_duchene@yahoo.fr>
Subject: Re: Constant as anonymous functions : the outer space beast is back
Date: Fri, 5 Feb 2010 14:41:50 -0800 (PST)
Date: 2010-02-05T14:41:50-08:00 [thread overview]
Message-ID: <9428b89d-1998-4d10-b244-89eac7c8d4ec@f12g2000yqn.googlegroups.com> (raw)
In-Reply-To: hki3t8$ucr$1@munin.nbi.dk
On 5 fév, 22:51, "Randy Brukardt" <ra...@rrsoftware.com> wrote:
> 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).
As you noticed later, Adam better expressed my implicit though, when
he talked about the Constant keyword, so this wouldn't apply the Count
of the example.
> 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.
I confess the rename case is a thorn there.
Good or bad, by the way ?
I not aware enough of some rationale, but I feel the Constant keyword
should be part of Constant renaming.
I'm not to suggest about it, I'm just noticing.
> Moreover, it doesn't make sense to treat constants and variables
> differently.
Does it make more sens to treat functions without parameter and
constants 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.
My concurrent though was that programmer could expect that changing a
declaration from constant to pure function only change the
implementation.
> 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).
Semantically, a constant is not a variable. Whenever you change a
constant to a variable, you are changing either the semantic or the
specification. This objection is thus unsuitable to me. There is no
legitimate reason to change a constant into a variable, unless you are
changing the specification (and in turn, everything relying on it
should be revised anyway). While changing a constant into a function
could be legitimate (this is just changing the implementation, not the
specification).
Why would you turn a constant into a variable, unless you are changing
some specifications ?
> 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.
Indeed, nothing is guaranteeing I'm right.
> 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),
I don't have any trouble with Use clauses, I am never Using.
> but that idea
> didn't get any traction. So nothing is going to change in this area.
>
> Randy.
I'm not aware of ADA Issues news (I use to receive it, but gave up as
there was too much mails to me), but I may have a look at what you are
talking about.
Thanks for your comments
next prev parent reply other threads:[~2010-02-05 22:41 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
2010-02-05 22:41 ` Hibou57 (Yannick Duchêne) [this message]
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