On Wed, 26 Jun 2013, Guillermo Polito wrote:
On Wed, Jun 26, 2013 at 11:20 PM, Levente Uzonyi <leves@elte.hu> wrote:
� � � On Wed, 26 Jun 2013, Cl�ment Bera wrote:
� � � � � � Actually this code:�
� � � � � � True basicNew ifTrue: [ "some code" ]
� � � � � � works fine on the latest Pharo 3 because of Opal :)
So the Opal compiler lacks important optimizations. :)
So it generates a bunch of extra bytecodes for every #ifTrue:, #ifFalse:, #ifTrue:ifFalse: and #ifFalse:ifTrue: messages, in order to make this thing work? Or is there a trick to avoid the duplicaiton of the code in the blocks?
Not at all. In fact, the the code is optimized and falls back to the normal lookup in case of exceptional #mustBeBoolean, so the existing code keeps running the same speed ;)
Levente
�
� � � Levente
� � � � � � But nice trick for the old compiler :)
� � � � � � 2013/6/26 Nicolas Cellier <nicolas.cellier.aka.nice@gmail.com>
� � � � � � � � � Because you don't know the tricks... This one should be just fine
� � � � � � � � � True basicNew ifTrue: [ "some code" ] yourself
� � � � � � 2013/6/26 Cl�ment Bera <bera.clement@gmail.com>
� � � � � � � � � True basicNew ifTrue: [ "some code" ]
� � � � � � hehe raises NonBooleanReceiver :)
� � � � � � 2013/6/26 Camillo Bruni <camillobruni@gmail.com>
� � � � � � � � � why not, let's "forbid" them with an error message!
� � � � � � � � � => maybe you can and error to #become: on nil / true / false as well?
� � � � � � � � � On 2013-06-26, at 14:20, Torsten Bergmann <astares@gmx.de> wrote:
� � � � � � � � � > Boolean new � � � �-> error
� � � � � � � � � > Boolean basicNew � -> is possible
� � � � � � � � � >
� � � � � � � � � > should we care?
� � � � � � � � � >