Il 28/02/2012 15:00, Gwenaël Casaccio ha scritto:
>>
> I've made a MirrorPrimitive and two pragmas; the first pragma calls the
> primitive
> but the second has an extra argument an error block (i.e. vmPrimitive
> for: ... at: ifFailed: [])
> Thus no exceptions are raised (and thus no possible leaked vmPrimitves
> objects).
> The primitive number is added at the end by the pragma. I've added the
> compiled
> method as an extra parameter to the execute_primitive function.
> 
> classFor: anObject [
> <mirrorPrimtive: VMpr_Object_Class>
> ]
> 
> for: anObject at: anIndex ifFailed: aBlock [
> <mirrorPrimtiveWithBlock: VMpr_Object_basicAt>
>     ^aBlock value
> ]

Do you need the second?  Perhaps you can just call ^self
primitiveFailed, and catch the exception in the caller.  Mirror
primitives that can fail shouldn't be on a fast path, should they?
Otherwise looks good.

Paolo

_______________________________________________
help-smalltalk mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/help-smalltalk

Reply via email to