[newbie] Complex boolean value?
Ned Konz
ned at bike-nomad.com
Sun Jun 17 20:40:15 UTC 2001
On Sunday 17 June 2001 11:15, Frantisek Fuka wrote:
> Sorry about my stupid question but I started to experiment with Squeak
> yesterday and when I wanted to come up with Boolean expression to check
> if any of the 3 conditions is true, I came up with this:
>
> ((value < 1 or: [value > x1]) or: [value > x2])
> ifTrue: [self error: 'Invalid value'].
>
> It works, but it looks rather complex. How to do this more "cleanly",
> with less parentheses?
(value between: 1 and: (x1 min: x2))
ifFalse: [ ... ]
--
Ned Konz
currently: Stanwood, WA
email: ned at bike-nomad.com
homepage: http://bike-nomad.com
More information about the Squeak-dev
mailing list
|