Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.csd.uwm.edu!cs.utexas.edu!uunet!wuarchive!texbell!sugar!ficc!peter
From: peter@ficc.uu.net (Peter da Silva)
Newsgroups: comp.lang.misc
Subject: Re: What I'd really like to see in an if-statement...
Message-ID: <5716@ficc.uu.net>
Date: 16 Aug 89 15:11:06 GMT
References: <178@enea.se> <3829@bd.sei.cmu.edu> <5689@ficc.uu.net> <2452@cbnewsc.ATT.COM>
Organization: Xenix Support, FICC
Lines: 32

In article <2452@cbnewsc.ATT.COM>, nevin1@cbnewsc.ATT.COM (nevin.j.liber) writes:
> In article <5689@ficc.uu.net> peter@ficc.uu.net (Peter da Silva) writes:
> |In article <3829@bd.sei.cmu.edu>, firth@sei.cmu.edu (Robert Firth) writes:
   [ in BCPL ]
> |> 	if x < f() < y do ...

> |> might call f() once or twice, for reasons difficult to explain to a
> |> beginner.

> |If the language is designed so that f() can be called twice,
> |then that is a design flaw.

> But is f() even called once??

In this case, yes. If it's !x < y < f() < z!, then maybe not.

> Suppose x=1 and y=0.  I do the x comparison first.

Why? You don't know that the language specifies that this statement
makes any assumptions about x relative to y. I know BCPL doesn't, and
that's the language we're immediately referencing.

> I can see arguments both ways; either
> decision will have a profound effect on the resulting language.

Vice-versa, the language will have a profound effect on the decision.
-- 
Peter da Silva, Xenix Support, Ferranti International Controls Corporation.
Business: peter@ficc.uu.net, +1 713 274 5180. | "The sentence I am now
Personal: peter@sugar.hackercorp.com.   `-_-' |  writing is the sentence
Quote: Have you hugged your wolf today?  'U`  |  you are now reading"