Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!samsung!munnari.oz.au!goanna!wren!ajk From: ajk@wren.cs.rmit.OZ.AU (Alan Kent) Newsgroups: comp.lang.eiffel Subject: Re: Old confusion Keywords: old, ensure, postconditions Message-ID: Date: 24 May 91 00:23:51 GMT References: <1991May21.040742.1520@syacus.acus.oz.au> <1166@tetrauk.UUCP> <1991May23.212347.23486@leland.Stanford.EDU> Sender: news@goanna.cs.rmit.oz.au Distribution: comp Lines: 21 craig@leland.Stanford.EDU (Craig Chambers) writes: >2. Do you actually believe that functions should be side-effect-free? ... >Perhaps an intermediate step would be to support both procedures that >can return results *and* compiler-enforced side-effect-free functions; >only the latter could be used in assertions. I also like the idea of side-effect-free functions, but I need them for a slightly different reason. What I need them for is if I write a query evaluator to evaluate a query from a parse tree, I should be able to write an optimizer which rearranges the tree without changing the result of the query. This requires that all functions called are without detectable side effects. It also has some interesting potential for compiler optimization, although I do not know how practical it would be. ps: What was that OOSC thing you mentioned a few times? Sounds interesting... Alan Kent ajk@goanna.cs.rmit.oz.au