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=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=unavailable autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,4180a73b05d119c7 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-04-01 16:24:26 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!cyclone.bc.net!newsfeed.media.kyoto-u.ac.jp!newsfeed.icl.net!newsfeed.fjserv.net!proxad.net!teaser.fr!enst.fr!not-for-mail From: "Alexandre E. Kopilovitch" Newsgroups: comp.lang.ada Subject: Re: ML-like alternatives to out parameters for functions Date: Wed, 2 Apr 2003 04:23:16 +0400 (MSD) Organization: h w c employees, b f Message-ID: Reply-To: "comp.lang.ada mail to news gateway" NNTP-Posting-Host: marvin.enst.fr Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: avanie.enst.fr 1049243065 68038 137.194.161.2 (2 Apr 2003 00:24:25 GMT) X-Complaints-To: usenet@enst.fr NNTP-Posting-Date: Wed, 2 Apr 2003 00:24:25 +0000 (UTC) To: comp.lang.ada@ada.eu.org Return-Path: X-Mailer: Mail/@ [v2.44 MSDOS] X-BeenThere: comp.lang.ada@ada.eu.org X-Mailman-Version: 2.1 Precedence: list List-Id: comp.lang.ada mail to news gateway List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Xref: archiver1.google.com comp.lang.ada:35873 Date: 2003-04-02T04:23:16+04:00 Frank J. Lhota (NOSPAM.lhota.adarose@verizon.net) wrote: >In most cases, parameter modes are an aid to both the compiler and the >programmer, telling them when we can assume that an actual parameter could >be altered and when its state will remain the same. In the case of the >Random function, however, the parameter mode is a lie. The function >specification indicates that the Gen parameter is not modified by a call to >Random, even though we all know that it does indeed get modified. This is an >inelegant kludge, >... Yes, it certainly looks like a kludge. This is even more annoying because (as it was once explained in Ada-Comment list) there are good reasons for that solution for the Random (some tasking issues, I recall). It seems that for such cases, a real cure should not be permission of IN OUT parameters for functions (this is a separate issue, and it is, perhaps, locked for ages... it deserves at least a separate section at the AdaPower site -:) . Let's introduce new parameter mode, say, PASS mode, which is applicable for access parameters only. With this mode one can pass an access parameter to a subroutine, explicitly stating that this is access for update, while IN mode will not give permission for update. Alexander Kopilovitch aek@vib.usr.pu.ru Saint-Petersburg Russia