logo       

Re: FFI, pragma and co...: msg#00176

lang.smalltalk.squeak.beginners

Subject: Re: FFI, pragma and co...


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


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise