🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.misc
Article #503

Re: What I'd really like to see in an if-statement...

#503
From: Peter da Silva
Date: Wed, 16 Aug 1989 15:11
32 lines
1776 bytes
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<y
> 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"
Technical Details
Message-ID: <5716@ficc.uu.net>
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.csd.uwm.edu!cs.utexas.edu!uunet!wuarchive!texbell!sugar!ficc!peter
References: <178@enea.se> <3829@bd.sei.cmu.edu> <5689@ficc.uu.net> <2452@cbnewsc.ATT.COM>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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