[Pharo-project] could we agree to remove caseOf: and caseOf:otherwise:

Eliot Miranda eliot.miranda at gmail.com
Tue Feb 15 19:59:59 CET 2011


On Mon, Feb 14, 2011 at 11:00 PM, Stéphane Ducasse <
stephane.ducasse at inria.fr> wrote:

> Eliot
>
> you use caseOf: for the generation of C in Slang and VM maker.
> Now this means that
>        - it does not need to be inlined
>

No.  If it is not inlined the simulator will go *much* slower.  e.g.

CogVMSimulatorLSB>>byteAt: byteAddress
| lowBits long |
lowBits := byteAddress bitAnd: 3.
long := self longAt: byteAddress - lowBits.
^(lowBits caseOf: {
[0] -> [ long ].
[1] -> [ long bitShift: -8  ].
[2] -> [ long bitShift: -16 ].
[3] -> [ long bitShift: -24 ]
}) bitAnd: 16rFF



>        - it could be packaged with VMMaker
>

No.  It needs to be in the compiler to be inlined.  Why have you got on this
hobby-horse?  It is a non-issue.  caseOf: ios not widelty used but extremely
useful in certain circumstances.  This has the feeling of a religious
pogrom, not a rational approach to the system.  IIABDFI = If It Ain't Broke,
Don't Fix It.


> Are these two points correct?
>

No, IMO, definitely not.


>
> Stef
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gforge.inria.fr/pipermail/pharo-project/attachments/20110215/7c031a36/attachment.htm>


More information about the Pharo-project mailing list