[squeak-dev] I was surprised
Levente Uzonyi
leves at caesar.elte.hu
Tue Jan 3 18:11:00 UTC 2017
If you use #or: instead of #| (which should always be the case IMO,
because you hardly ever want non-short-circuit boolean evaluation), then
you'll probably not forget the parentheses:
'a' = 'a' or: [ 'a' = 'b' ] "==> true"
Or even if you do forget them, you'll still get the expected result
because of the higher precedence:
'a' = 'a' or: 'a' = 'b' "==> true"
Levente
On Tue, 3 Jan 2017, Bob Arning wrote:
>
> Or by people making a mistake
>
> 'a' = 'a' | 'a' = 'b' ==> false
>
>
> On 1/3/17 10:06 AM, Bert Freudenberg wrote:
> On Tue, Jan 3, 2017 at 1:17 PM, Bob Arning <arning315 at comcast.net> wrote:
>
> This has been this way for aeons, but it surprised me:
>
> false | 'hello' ==> 'hello'
>
> Does anything actually depend on this being this way?
>
> Unlikely. It's only ever used with booleans.
>
> - Bert -
>
>
>
>
>
More information about the Squeak-dev
mailing list
|