🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.misc
Article #490

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

#490
From: nevin.j.liber
Date: Wed, 16 Aug 1989 01:22
20 lines
1354 bytes
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:

|> 	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??  Suppose x=1 and y=0.  I do the x<y
comparison first.  Since I now know that the entire expression is false,
should I bother to evaluate f()?  I can see arguments both ways; either
decision will have a profound effect on the resulting language.
-- 
 _ __	NEVIN ":-)" LIBER  nevin1@ihlpb.ATT.COM  (312) 979-4751  IH 4F-410
' )  )			 "We are almost into the '90s; *nothing* is wierd."
 /  / _ , __o  ____	   -- Buzz Kelman, Newsman & Bluesman, WLUP, 7/28/89
/  (_</_\/ <__/ / <_	As far as I know, these are NOT the opinions of AT&T.
Technical Details
Message-ID: <2452@cbnewsc.ATT.COM>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watmath!att!cbnewsc!nevin1
References: <178@enea.se> <3829@bd.sei.cmu.edu> <5689@ficc.uu.net>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watmath!att!cbnewsc!nevin1
From: nevin1@cbnewsc.ATT.COM (nevin.j.liber)
Newsgroups: comp.lang.misc
Subject: Re: What I'd really like to see in an if-statement...
Message-ID: <2452@cbnewsc.ATT.COM>
Date: 16 Aug 89 01:22:40 GMT
References: <178@enea.se> <3829@bd.sei.cmu.edu> <5689@ficc.uu.net>
Reply-To: nevin1@cbnewsc.ATT.COM (nevin.j.liber)
Organization: AT&T Bell Laboratories
Lines: 20