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-Thread: 103376,e528d54e6cc3c10d X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!proxad.net!usenet-fr.net!enst.fr!melchior!cuivre.fr.eu.org!melchior.frmug.org!not-for-mail From: "Alexander E. Kopilovich" Newsgroups: comp.lang.ada Subject: Re: why only in-parameters in functions Date: Wed, 29 Sep 2004 20:55:05 +0400 (MSD) Organization: Cuivre, Argent, Or Message-ID: References: NNTP-Posting-Host: lovelace.ada-france.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: melchior.cuivre.fr.eu.org 1096477842 13936 212.85.156.195 (29 Sep 2004 17:10:42 GMT) X-Complaints-To: usenet@melchior.cuivre.fr.eu.org NNTP-Posting-Date: Wed, 29 Sep 2004 17:10:42 +0000 (UTC) To: comp.lang.ada@ada-france.org Return-Path: In-Reply-To: ; from Rick Santa-Cruz at Wed, 29 Sep 2004 17:18:06 +0200 X-Mailer: Mail/@ [v2.44 MSDOS] X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at ada-france.org X-BeenThere: comp.lang.ada@ada-france.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: "Gateway to the comp.lang.ada Usenet newsgroup" List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Xref: g2news1.google.com comp.lang.ada:4396 Date: 2004-09-29T20:55:05+04:00 Rick Santa-Cruz wrote: > I know that it is only allowed to use in-parameters with functions. But I > can't figure out what is the idea behind this. Why did the Ada-Team only > allow in-parameter when using functions? There were so many discussions on this matter, at various levels, and so manu arguments pro and contra were expressed that perhaps there should be FAQ for this topic alone. In short, for many years Ada community and ARG (which can be seen as Ada design team) were (and still are) divided about this matter. In practice, where you really need in-parameters for a function you may either use a procedure that returns value (if you use GNAT compiler) or you may use the construct, presented here in c.l.a by Robert I. Eachus (see his message in comp.lang.ada from 2003-07-15 with Subject: Re: What evil would happen?) ---------------------------------------------------------------------------- function Random(Gen: in Generator) return ... Local: Generator; for Local'Address use Gen'Address; begin ... end Random; ---------------------------------------------------------------------------- Alexander Kopilovich aek@vib.usr.pu.ru Saint-Petersburg Russia