🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.misc
Article #471

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

#471
From: Robert Firth
Date: Mon, 14 Aug 1989 20:02
20 lines
1111 bytes
In article <178@enea.se> sommar@enea.se (Erland Sommarskog) writes:

[ allowing 'x<y<z' to mean 'x<y & y<z']

>Actually I have always been surprised that no language I have dealt
>have had this feature since it is so easy to implement. Am I overlook-
>ing something?

The above is a feature of the language BCPL.  In simple cases, it
works very well indeed:

	if 'A' <= ch <= 'Z' do ...

In complicated cases, it can trip you up:

	if x < f() < y do ...

might call f() once or twice, for reasons difficult to explain to a
beginner.  And beginners have this habit of trying complicated cases,
rather the way kittens like ravelling string.
Technical Details
Message-ID: <3829@bd.sei.cmu.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!iuvax!cica!tut.cis.ohio-state.edu!pt.cs.cmu.edu!sei!firth
References: <178@enea.se>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!iuvax!cica!tut.cis.ohio-state.edu!pt.cs.cmu.edu!sei!firth
From: firth@sei.cmu.edu (Robert Firth)
Newsgroups: comp.lang.misc
Subject: Re: What I'd really like to see in an if-statement...
Message-ID: <3829@bd.sei.cmu.edu>
Date: 14 Aug 89 20:02:59 GMT
References: <178@enea.se>
Reply-To: firth@sei.cmu.edu (Robert Firth)
Organization: Software Engineering Institute, Pittsburgh, PA
Lines: 20