--- Begin Message ---I guess you can circumvent the inlining by using perform (and selecting the code with "debug it" from the menu) as in: true perform: #ifTrue: with: [ 3 inspect ] ----------------- Benoît St-Jean Yahoo! Messenger: bstjean Twitter: @BenLeChialeux Pinterest: benoitstjean Instagram: Chef_Benito IRC: lamneth Blogue: endormitoire.wordpress.com "A standpoint is an intellectual horizon of radius zero". (A. Einstein)From: Nicolas Passerini <npasser...@gmail.com> To: Any question about pharo is welcome <pharo-users@lists.pharo.org> Sent: Monday, October 31, 2016 9:32 AM Subject: Re: [Pharo-users] How does Boolean ifTrue work? Well, in fact Boolean class has no instances, the boolean value true is an instance of True class, you should look at the ifTrue: methods in the subclasses of Boolean True and False. But also, ifTrue: expressions are inlined, as the comment says in the code you posted. So I think that all this ifTrue: methods are never actually executed. 2016-10-31 14:17 GMT+01:00 CodeDmitry <dimamakh...@gmail.com>: I am looking at ifTrue: alternativeBlock "If the receiver is false (i.e., the condition is false), then the value is the false alternative, which is nil. Otherwise answer the result of evaluating the argument, alternativeBlock. Create an error notification if the receiver is nonBoolean. Execution does not actually reach here because the expression is compiled in-line." self subclassResponsibility In order to perform the block, ifTrue must somehow end up evaluating the block, but this code only sends a subclassResponsibility message to itself and implicitly returns itself. Where does the block actually get evaluated? -- View this message in context: http://forum.world.st/How- does-Boolean-ifTrue-work- tp4920873.html Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
--- End Message ---
Re: [Pharo-users] How does Boolean ifTrue work?
Benoit St-Jean via Pharo-users Fri, 04 Nov 2016 03:20:06 -0700
- [Pharo-users] How does Boolean ifTrue work? CodeDmitry
- Re: [Pharo-users] How does Boolean ifT... Sven Van Caekenberghe
- Re: [Pharo-users] How does Boolean ifT... Cyril Ferlicot D.
- Re: [Pharo-users] How does Boolean ifT... Nicolas Passerini
- Re: [Pharo-users] How does Boolean... Benoit St-Jean via Pharo-users
- Re: [Pharo-users] How does Boolean ifT... CodeDmitry
- Re: [Pharo-users] How does Boolean... Thierry Goubier
- Re: [Pharo-users] How does Boo... CodeDmitry
- Re: [Pharo-users] How does... Thierry Goubier
- Re: [Pharo-users] How... CodeDmitry
- Re: [Pharo-users]... p...@highoctane.be
- Re: [Pharo-users]... Thierry Goubier
- Re: [Pharo-us... CodeDmitry
- Re: [Pharo-us... Esteban A. Maringolo
- Re: [Pharo-us... CodeDmitry