From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, FREEMAIL_REPLY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,38fc011071df5a27 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-06-19 13:22:49 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: Brian.Gaffney@myrealbox.com (Brian Gaffney) Newsgroups: comp.lang.ada Subject: Re: Ideas for Ada 200X Date: 19 Jun 2003 13:22:47 -0700 Organization: http://groups.google.com/ Message-ID: <5e9b8c34.0306191222.6c9fd0ec@posting.google.com> References: <3EECA772.4B662024@adaworks.com> <5e9b8c34.0306181050.3c4cc664@posting.google.com> NNTP-Posting-Host: 137.244.215.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1056054168 4543 127.0.0.1 (19 Jun 2003 20:22:48 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 19 Jun 2003 20:22:48 GMT Xref: archiver1.google.com comp.lang.ada:39457 Date: 2003-06-19T20:22:48+00:00 List-Id: 18k11tm001@sneakemail.com (Russ) wrote > Brian.Gaffney@myrealbox.com (Brian Gaffney) wrote >> >> procedure "+" (Left : in out Integer; Right : in Integer); >> ... > >"+" is a function that returns the sum of its two arguments without >modifying either of those arguments. In _Ada95_, this is true [actually, to be accurate, in Ada95 "+" is a function that takes two arguments and returns a result without modifying either of those arguments (isn't that redundant?), the default implementation of which returns the sum of the two arguments -- I'm not sure it is even restricted that much, there is also a version with one argument]. Is there some fundamental limitation which makes this different from Get? I could define these: procedure Get (Left : in out Integer; Right : in Integer); function Get (Left : Integer; Right : Integer) return Integer; and GNAT at least doesn't seem to have any objection to it. In what way is the notation "+" special (besides the restrictions that the language puts on it, which is what we're talking about changing)? >How could it also be a procedure that modifies one of its arguments? It's called overloading: procedure "+" (Left : in out Integer; Right : in Integer); function "+" (Left : Integer; Right : Integer) return Integer; would be perfectly reasonable (though I won't comment on its desirability). >You think the same symbol taking the same argument types can be >used for both a procedure and a function? Yes. >It's no wonder you put the word "problem" in quotes: you >don't understand the problem. If the problem is different than: "I want a way to duplicate c++/c+=1/c-=1/--c/... in Ada0Y" then I must have responded to the wrong thread. The reason I put in quotes is that I don't see it as anything that needs to be fixed. You're welcome to disagree.