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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,29fe9a340e0d180d X-Google-Attributes: gid103376,public From: hbaker@netcom.com (Henry Baker) Subject: Re: Depending on passing mechanism Date: 1997/10/22 Message-ID: #1/1 X-Deja-AN: 282299509 Sender: hbaker@netcom4.netcom.com References: <622b4t$nhe$1@gonzo.sun3.iaf.nl> Organization: nil Newsgroups: comp.lang.ada Date: 1997-10-22T00:00:00+00:00 List-Id: In article , dewar@merv.cs.nyu.edu (Robert Dewar) wrote: > On the contrary, leaving the order of evaluation undefined will actively > discourage the use of such side effects, a good thing! > > However, this is a bad idea, which, once the full issues are examined, never > gets more than a splinter of support. The trouble is that there are many > legitimate uses for functions with side effects, an obvious example among > many being the use of memo functions. The problem with side-effects is that people want to _encapsulate_ side-effects in order to produce functions. Furthermore, things that _look_ like side-effects to a compiler -- e.g., 'cons' in Lisp -- turn out not to be side-effects at the next level up in abstraction. So unless your language offers a really good understanding of abstraction and encapsulation, it should punt and assume that the programmer knows what he/she is doing. ---- The problem with Bob's comments about discouraging side-effects with non-determinism is that this is a terrible thing to do to 90% of the code which doesn't care about performance. You should annotate for the 10% which cares about performance, and _not_ annotate for the rest. Unfortunately, the specmark stuff forces the exact opposite behavior. By not allowing annotations (except in the form of incomprehensible and never-used compile-time 'switches'), they force bad programming styles for the bulk of the code which is not performance sensitive.