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-14 02:08:52 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!newsfeed.freenet.de!fu-berlin.de!uni-berlin.de!tar-alcarin.cbb-automation.DE!not-for-mail From: Dmitry A. Kazakov Newsgroups: comp.lang.ada Subject: Re: What evil would happen? Date: Mon, 14 Jul 2003 11:09:59 +0200 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: tar-alcarin.cbb-automation.de (212.79.194.111) Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de 1058173730 8806938 212.79.194.111 (16 [77047]) X-Newsreader: Forte Agent 1.8/32.548 Xref: archiver1.google.com comp.lang.ada:40256 Date: 2003-07-14T11:09:59+02:00 List-Id: On Sun, 13 Jul 2003 13:28:54 -0400, "Chad R. Meiners" wrote: >"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. So what is the point? >>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. It is also my view. But I see rather other consecuences from this: 1. All functions are pure. So no access parameters allowed, no access to global data from the body is allowed etc. 2. But procedures are allowed to have a result. This would be perfectly consistent and as safe as possible. >> 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. In mathematics you can encapsulate all side effects in objects of unlimited complexity. It is not the case for programming languages. Especially ones with weak type inference capability. --- Regards, Dmitry Kazakov www.dmitry-kazakov.de