logo       

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

lang.smalltalk.squeak.beginners

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



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

(a) Time millisecondsToRun:[50000 timesRepeat: [1@1]]  ->  12

then I commentet the primitive call to see the diffirence in Number>>@
and I saw no difference...
so I put a self halt in @

and the method isn't stopped when I redo (a).

but if I do that in a worspace:

|a|
a := 1. self halt.
Time millisecondsToRun:[50000 timesRepeat: [1@(a+1)]].

It stops and then the halt in #@ works ok ...

any idea of what I did wrong ?

Thanks
Cédrick

_______________________________________________
Beginners mailing list
Beginners@xxxxxxxxxxxxxxxxxxxxxxxxxx
http://lists.squeakfoundation.org/mailman/listinfo/beginners
<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise