[Newbies] FFI, pragma and co...

stéphane ducasse ducasse at iam.unibe.ch
Mon Aug 21 12:41:10 UTC 2006


>
> Additionally, some primitives are optional, they are only used to  
> speed up lengthy computations. Like searching in a string or adding  
> large numbers (ever tried "1000 factorial" ?). If the primitive is  
> not available, the Smalltalk code will be executed instead.

look at @
the point creation method is sped up using an optional primitive call.

@ y
	"Primitive. Answer a Point whose x value is the receiver and whose y
	value is the argument. Optional. No Lookup. See Object documentation
	whatIsAPrimitive."

	<primitive: 18>
	^Point x: self y: y




More information about the Beginners mailing list