[Newcompiler] about RBMethodNode >> #primitiveNode:
Mathieu Suen
mathieusuen at yahoo.fr
Mon Oct 2 11:24:13 UTC 2006
Philippe Marschall a écrit :
> Hi
>
> I just stumbeled on this, I think
>
> primitiveNode: aPrimitiveNode
>
> (primitiveNode isNil
> or: [ primitiveNode num = 0 ]
> or: [ primitiveNode num = aPrimitiveNode num ])
> ifTrue: [ primitiveNode := aPrimitiveNode ]
> ifFalse: [ self notify: 'Ambigous primitives' ]
>
> makes more sense and is easier to read and understand than the existing
>
> primitiveNode: aPrimitiveNode
>
> primitiveNode ifNil:[primitiveNode := aPrimitiveNode]
> ifNotNil:[(primitiveNode num = 0)
> ifTrue:[primitiveNode := aPrimitiveNode]
>
> ifFalse:[(aPrimitiveNode num = 0)
> ifFalse:[self notify:
> 'Ambigous primitives']]].
>
> Also it checks if the numbers are the same.
>
> Philippe
>
Thanks
Yes I will merge this when Marcus add my stuff about comment parsing.
Math
___________________________________________________________________________
Découvrez un nouveau moyen de poser toutes vos questions quelque soit le sujet !
Yahoo! Questions/Réponses pour partager vos connaissances, vos opinions et vos expériences.
http://fr.answers.yahoo.com
More information about the Newcompiler
mailing list