Login  Register

Re: Non-evaluating and / or

Posted by Peter Uhnak on Apr 03, 2015; 10:15am
URL: https://forum.world.st/Non-evaluating-and-or-tp4817211p4817213.html

Hi,

that's because you need to pass a block, since you want to postpone to execution.
i.e. false and: [Transcript open]. (otherwise the binary operation Transcript open will take precedence over keyword false and:)
You can always look at the implementation of those things — I always learn something from it. :)

»and: alternativeBlock«

Peter

On Fri, Apr 3, 2015 at 12:10 PM, Jan B. <[hidden email]> wrote:
Hello

I would like to ask how to do non-evaluating and.
As far as I know, & should be evaluating and and: should be non-evaluating.
However, I need to find a way how to use it properly.

In "conventional" languages I would expect to work it like in following
example...
  false and: Transcript open
Since false is... false... there is no reason to evaluate Transcript open.
But when I run this one in playground, transcript opens.

Any help is appreciated.

Jan



--
View this message in context: http://forum.world.st/Non-evaluating-and-or-tp4817211.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.