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,f3437064e1091fec X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-07-12 06:22:37 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!news.tele.dk!news.tele.dk!small.news.tele.dk!uninett.no!ntnu.no!not-for-mail From: Preben Randhol Newsgroups: comp.lang.ada Subject: Re: What evil would happen? Date: Sat, 12 Jul 2003 13:22:37 +0000 (UTC) Organization: Norwegian university of science and technology Message-ID: References: <5ad0dd8a.0307111151.4a08f95a@posting.google.com> <1LEPa.9034$nP.7178@newsfep4-winn.server.ntli.net> <5ad0dd8a.0307120426.226775f1@posting.google.com> NNTP-Posting-Host: kiuk0152.chembio.ntnu.no X-Trace: tyfon.itea.ntnu.no 1058016157 10478 129.241.83.78 (12 Jul 2003 13:22:37 GMT) X-Complaints-To: usenet@itea.ntnu.no NNTP-Posting-Date: Sat, 12 Jul 2003 13:22:37 +0000 (UTC) User-Agent: slrn/0.9.7.4 (Linux) Xref: archiver1.google.com comp.lang.ada:40232 Date: 2003-07-12T13:22:37+00:00 List-Id: Larry Kilgallen wrote: > Being able to return an unconstrained value along with one or more > constrained values from the same subprogram: > > declare > my_result : Boolean; > my_username : constant := Parse_Username ( my_username : constant String := ... > s => "SYSTEM", > result => my_result ); > begin > -- make use of that > end; Well then functions with side effects should be more resonable than to make procedures into functions. But one could also simply use a function here and return "" if the parsing failed and then simply check if my_username /= "". You have to do if my_result then anyway so there is really not much difference to the code. However I would have concidered throwing an exception in the case the parsing failed. -- Ada95 is good for you. http://www.crystalcode.com/codemage/MainMenu/Coding/Ada/IntroducingAda.php