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=0.7 required=5.0 tests=BAYES_00,MSGID_RANDY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,5265ce03ee8f5252 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-01-04 05:21:22 PST Path: supernews.google.com!sn-xit-02!supernews.com!news.gv.tsc.tdk.com!newsfeed.berkeley.edu!news-hog.berkeley.edu!ucberkeley!newsfeed.stanford.edu!xfer10.netnews.com!netnews.com!feed2.news.rcn.net!rcn!news.maxwell.syr.edu!nntp2.deja.com!nnrp1.deja.com!not-for-mail From: Robert Dewar Newsgroups: comp.lang.ada Subject: Re: Ok sorry, it is just a book gives no feedback. Date: Thu, 04 Jan 2001 13:14:51 GMT Organization: Deja.com Message-ID: <931t08$5u5$1@nnrp1.deja.com> References: <931r2l$4ai5t$2@ID-25716.news.dfncis.de> NNTP-Posting-Host: 205.232.38.14 X-Article-Creation-Date: Thu Jan 04 13:14:51 2001 GMT X-Http-User-Agent: Mozilla/4.61 [en] (OS/2; U) X-Http-Proxy: 1.0 x69.deja.com:80 (Squid/1.1.22) for client 205.232.38.14 X-MyDeja-Info: XMYDJUIDrobert_dewar Xref: supernews.google.com comp.lang.ada:3649 Date: 2001-01-04T13:14:51+00:00 List-Id: In article <931r2l$4ai5t$2@ID-25716.news.dfncis.de>, "Nick Roberts" wrote: > My own opinion is that, generally, functions should have no > side effects This principle is in general a reasonable one, but it is not easy to define what this means. Nick goes on to give an explanation, but his explanation is wrong, it would forbid many functions, e.g. anything that allocates and returns a pointer, which is far too severe. Getting the explanation right is very hard (which is why the language does not attempt to enforce this). For example, memo functions clearly violate Nick's rules, but should be allowed. Also Nick's definition would not allow any instrumentation of functions, and that's wrong too. In any case, the answer is far afield from the question, at the level the question is asked, the answer is use a function if a value is returned use a procedure if no value is returned (yes that's not quite right either, but the question is not about subtle semantics and language design, it is more in the realm of "I don't understand any of this stuff, help!!!" :-) Sent via Deja.com http://www.deja.com/