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


_______________________________________________
Beginners mailing list
[email protected]
http://lists.squeakfoundation.org/mailman/listinfo/beginners

Reply via email to