FFI Callbacks

Diego Fernandez diegof79 at gmail.com
Fri Sep 1 18:40:01 UTC 2006


On 9/1/06, Alejandro F. Reimondo <aleReimondo at smalltalking.net> wrote:
> The <...> syntax is a short syntax notation to make a method
>  as a primitive method, calling a function (object) like
>  you instantiate for platformFunction (the object will be
>  instantiated by the compiler and bounded to the method
>  as a primitive) and returning the result (following normal
>  primitive failure policy).

I know that <> is used in primitives, but in calls to external
libraries there is a performance reason for this kind of notation?
Have this kind of methods different bycodes (like in primitives) or
it's only a shorthand for the longer expression?

> Dynamic function calls (instantiate functions on demand)
>  can be used, but are more long expressions.
> With dynamic functions you can call more than
>  one function in a method, but invalidate
>  senders/implementors as a powerful tool for browsing
>  (#call:with:... will return all API calls in the universe).
> Using <...> syntax let you choose better (smalltalk) selectors
>  for calls and let you bind the calls without reducing
>  browsing effectiveness.

What are the differences in browsing?
I don't see much appart from less typing, since you can find
references to ExternalLibraryFunction, and follow some "best practice"
to declare the function in one place.

Regards,
Diego.-



More information about the Squeak-dev mailing list