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,FREEMAIL_FROM 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-13 10:30:14 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!elk.ncren.net!nntp.upenn.edu!msunews!not-for-mail From: "Chad R. Meiners" Newsgroups: comp.lang.ada Subject: Re: What evil would happen? Date: Sun, 13 Jul 2003 13:28:54 -0400 Organization: Michigan State University Message-ID: References: <5ad0dd8a.0307111151.4a08f95a@posting.google.com> <1LEPa.9034$nP.7178@newsfep4-winn.server.ntli.net> <5ad0dd8a.0307120426.226775f1@posting.google.com> <5ad0dd8a.0307130417.41548778@posting.google.com> NNTP-Posting-Host: arctic.cse.msu.edu X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Xref: archiver1.google.com comp.lang.ada:40241 Date: 2003-07-13T13:28:54-04:00 List-Id: "Wojtek Narczynski" wrote in message news:5ad0dd8a.0307130417.41548778@posting.google.com... > Preben Randhol wrote in message news:... > > > Well then functions with side effects should be more resonable > > "Functions" with side effects can only inject their side effect into > where they have been hardcoded to. This is wrong. Function have the capability to randomly introduce side effects just like any other section of code. >This is a serious limitation. If it were true, I doubt it. In my experience, functions are more useful when they are pure. Sure there are times when a function cannot be pure, but sub-routine with a side-effect should be made a procedure in most cases. > Sorry, the reasoning that everything that has return statement is > a function is not very viable. In mathematics, functions only return single elements, which may be a composite of some sort. I suggest that if you want return composites from functions you should return a record type. type Composite(StringSize : Natural) is record User_Name : String(1..StringSize); Result : Boolean; end record; function Parse_User_Name(Item : String) return Composite; However, the following might also be a suitable procedure for the task procedure Parse_UserName (Item : String; UserName : out String; NameSize : out Natural) ; > Regards, > Wojtek -CRM