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.3 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,92d1af21ade61406 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-11-08 15:57:02 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!fr.usenet-edu.net!usenet-edu.net!enst.fr!not-for-mail From: "Alexandre E. Kopilovitch" Newsgroups: comp.lang.ada Subject: Re: Problems with 'class, help anyone? Date: Sat, 9 Nov 2 03:11:06 +0300 Organization: h w c employees, b f Sender: comp.lang.ada-admin@ada.eu.org Message-ID: Reply-To: comp.lang.ada@ada.eu.org NNTP-Posting-Host: marvin.enst.fr Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: avanie.enst.fr 1036799822 87290 137.194.161.2 (8 Nov 2002 23:57:02 GMT) X-Complaints-To: usenet@enst.fr NNTP-Posting-Date: Fri, 8 Nov 2002 23:57:02 +0000 (UTC) Return-Path: X-Mailer: BML [MS/DOS Beauty Mail v1.36H] Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org X-Mailman-Version: 2.0.13 Precedence: bulk List-Unsubscribe: , List-Id: comp.lang.ada mail<->news gateway List-Post: List-Help: List-Subscribe: , Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org Xref: archiver1.google.com comp.lang.ada:30617 Date: 2002-11-09T03:11:06+03:00 Robert A Duff (bobduff@shell01.TheWorld.com) wrote: >"Dmitry A. Kazakov" writes: [skip] >> just allow procedures with results: >> >> procedure Foo (...) return Bar; > >Yeah, and then eliminate the "function Foo..." syntax. >That would solve the problem! > >Slight incompatibility... ;-) There is another way, with perhaps even less incompatibility: let's introduce third mode for a formal parameter - "return" mode (in addition to conventional "in" and "out"). That "return" may be applied to the procedure's first parameter only, and it means the same as "out" mode, with single exception: if the first parameter of a procedure is in "return" mode then the procedure *may* be called without the corresponding (first) argument, and in such a case it returns value. For example: procedure Two_Fold(Result : return Boolean; Something : in Integer); X : Boolean; Two_Fold(X, 0); -- "return" as "out", procedure does not return value if Two_Fold(0) then -- first argument omitted, procedure returns value ... end if; Alexander Kopilovitch aek@vib.usr.pu.ru Saint-Petersburg Russia