Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.csd.uwm.edu!wuarchive!wugate!uunet!mcsun!ukc!edcastle!lfcs!db From: db@lfcs.ed.ac.uk (Dave Berry) Newsgroups: comp.lang.eiffel Subject: Re: a < b < c Message-ID: <287@castle.ed.ac.uk> Date: 31 Aug 89 10:46:15 GMT References: <239@enea.se> Sender: root@castle.ed.ac.uk Reply-To: db@lfcs.ed.ac.uk (Dave Berry) Organization: Laboratory for the Foundations of Computer Science, Edinburgh U Lines: 39 In article <239@enea.se> sommar@enea.se (Erland Sommarskog) writes: >I'm pleased to hear to contributed to Eiffel's development. There >is one more detail to think of though: > > a < b < f() > >Should the language guarantee that f is called? Or should the compiler >be allowed to skip the call if a >= b? Should the arguments be evaluated left-to-right, right-to-left, or in arbitrary order? Should the argument be evaluated exactly once, at most once, or any number of times? If the value of the expression is known before all the arguments are evaluated, must the remaining arguments be evaluated, must they not be evaluated, or is it up to the compiler? The only strong feeling I have about these issues is that an argument should not be evaluated more than once. I.e. a < f() < b should not be equivalent to a < f() and f() < b but to tmp1 := a -- if evaluation is left-to-right tmp2 := f() tmp1 < tmp2 and tmp2 < b Dave Berry, Laboratory for Foundations db%lfcs.ed.ac.uk@nsfnet-relay.ac.uk of Computer Science, Edinburgh Uni. !mcvax!ukc!lfcs!db "Another hope, another dream, another truth, installed by the machine."