On 04/08/2015 01:45 PM, Roland Plüss wrote: > And as far as I know I can't include any code into a <primitive> > declared method. > > I once did the trick with errno type error handling in a module I made > for Smalltalk but it's cumbersome to use and error prone. >> <primitive> will execute the Smalltalk code in case the primtive >> failed. E.g. for the Array >> >> kernel/Array.st- at: anIndex ifAbsent: aBlock [ >> kernel/Array.st- "Answer the index-th indexed instance variable of >> the receiver" >> kernel/Array.st- >> kernel/Array.st- <category: 'built ins'> >> kernel/Array.st: <primitive: VMpr_Object_basicAt> >> kernel/Array.st- ^self checkIndexableBounds: anIndex ifAbsent: aBlock >> kernel/Array.st- ] >> > When exactly does a primitive fail and how can I trigger this from > inside a cCall? This might actually be abused for a little trick if > working right. > Maybe the question got lost in the mailing list? What does make a primitive fail as seen from the Smalltalk VM?
-- Yours sincerely Plüss Roland Leader and Head Programmer - Game: Epsylon ( http://www.indiedb.com/games/epsylon ) - Game Engine: Drag[en]gine ( http://www.indiedb.com/engines/dragengine , http://dragengine.rptd.ch/wiki ) - Normal Map Generator: DENormGen ( http://epsylon.rptd.ch/denormgen.php ) - As well as various Blender export scripts und game tools
signature.asc
Description: OpenPGP digital signature
_______________________________________________ help-smalltalk mailing list [email protected] https://lists.gnu.org/mailman/listinfo/help-smalltalk
