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

Stéphane Ducasse stephane.ducasse at inria.fr
Wed Feb 16 22:00:32 CET 2011


Ok this is my last mail on that topic.


> yes now do not think that I'm implying that you are not able to implement a decompiler.
> Now we have something else to do that dealing with the optimisation of a stupid method.
> This is all my point.
> Let us focus on the real problems. eliot is crying for caseOf: but we have 3 users.
> 
> Did you know that there are several uses of caseOf: in the Opal compiler?


(selector := aMessageNode selector)
		caseOf:
			{([ #ifNil: ]
				-> [ self isValueTranslator ifTrue: [ methodBuilder pushDup ] ]).
			([ #ifNil:ifNotNil: ]
				-> [ args last arguments ifNotEmpty: [ args last arguments first binding emitStore: methodBuilder ] ]).
			([ #ifNotNil: ]
				-> [ args first arguments ifNotEmpty: [ args first arguments first binding emitStore: methodBuilder ] ]).
			([ #ifNotNilDo: ]
				-> [ args first arguments ifNotEmpty: [ args first arguments first binding emitStore: methodBuilder ] ]).
			([ #ifNotNil:ifNil: ]
				-> [ args first arguments ifNotEmpty: [ args first arguments first binding emitStore: methodBuilder ] ])}.



>  Do you have such an encyclopaedic knowledge of all the packages ever written in Pharo and Squeak that you know* you have only 3 users?  Of course you don't.  You are being ridiculous. 

Now when opal will arrive people should be prepared that probably caseOf: will not be inlined. 

Stef



More information about the Pharo-project mailing list