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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ad988eb0a9545c86 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-04-14 08:33:54 PST Path: supernews.google.com!sn-xit-02!supernews.com!news.tele.dk!212.74.64.35!colt.net!diablo.netcom.net.uk!netcom.net.uk!not-for-mail From: "Ayende Rahien" Newsgroups: comp.lang.ada Subject: Re: Problem trying to implement generics. Date: Sat, 14 Apr 2001 18:30:50 +0200 Organization: (Posted via) GTS Netcom - Public USENET Service http://pubnews.netcom.net.uk Sender: ayende@softhome.net Message-ID: <9b9qjc$nk9$1@taliesin.netcom.net.uk> References: <9b46dr$cd8$1@taliesin.netcom.net.uk> <9b6jtu$4is$2@taliesin.netcom.net.uk> <9b6m27$68e$1@taliesin.netcom.net.uk> <0JBB6.10484$FD1.1197250@news6-win.server.ntlworld.com> <9b7tce$laf$2@taliesin.netcom.net.uk> <9b85fj$25r$1@taliesin.netcom.net.uk> <3AD858A3.3070803@elros.cbb-automation.de> NNTP-Posting-Host: diup-181-74.inter.net.il X-Trace: taliesin.netcom.net.uk 987262383 24201 213.8.181.74 (14 Apr 2001 15:33:03 GMT) X-Complaints-To: abuse@corp.netcom.net.uk NNTP-Posting-Date: Sat, 14 Apr 2001 15:33:03 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.60.2296.0000 X-MimeOLE: Produced By Microsoft MimeOLE V5.60.2296.0000 Xref: supernews.google.com comp.lang.ada:6892 Date: 2001-04-14T18:30:50+02:00 List-Id: "Dmitry A. Kazakov" wrote in message news:3AD858A3.3070803@elros.cbb-automation.de... > > > Brian Rogoff wrote: > > > On Sat, 14 Apr 2001, Ayende Rahien wrote: > > > >> "Brian Rogoff" wrote in message > >> > >>> Or, would you just allow procedures to return values? ;-) > >> > >> No, but I would like to have a function that I can place in an if (etc) that > >> change the variables I gives it. > > > > You can achieve this with access parameters, or the trick that Robert Duff > > described (which obviously only works for limited types). > > > >> It's not a big deal, I was just wondering what was the reason for this decistion. > > > > A desire to have Ada functions correspond more closely to mathematical > > functions, which don't modify their arguments? I think in general it is > > good style *not* to have functions modifying their arguments, but as usual > > there are relatively rare exceptions. I think it would have been better to > > allow out and in-out params, and make sure that programmers who abuse them > > are beaten severely. > > > > You're right, it shouldn't be too big of a deal for you. And I doubt it > > will ever change in any future version of Ada, since enough people seem > > to really like this restriction. > > Well, but what I still cannot understand, what is the objection against > *procedures* returning a value: Because that is the difference between functions & procedures? If you wanted it that way, you could do this: function Foo(...) return nothing; But I agree that it would be nice to be able to ignore function's return value. > procedure Foo (...) return ...; > > A related question is a syntax sugar to ignore unused result of an expression. For instance, instead of clumsy > > declare > Dummy : Integer; > begin > Dummy := Some_API_Call (...); > end; > > something like: > > null Some_API_Call (...); > > Regards, > Dmitry Kazakov >