Path: 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

In article <178@enea.se> sommar@enea.se (Erland Sommarskog) writes:

[ allowing 'xActually 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.