FFI Callbacks

Diego Fernandez diegof79 at gmail.com
Fri Sep 1 15:45:06 UTC 2006


I don't know anything about the internals but I like how callbacks are
declared in VAST:

windowProc := EsEntryPoint
       receiver: [:hwnd :lParam | "call back object to be executed" ]
       selector: #value:value:
       callingConvention: 'c'
       arrayBased: false
       parameterTypes: #(uint32 pointer)
       returnType: #boolean.

platformFunction := PlatformFunction
       callingConvention: 'c'
       function: 'EnumWindows'
       library: 'user32'
       parameterTypes: #(pointer uint32)
       returnType: #boolean.

platformFunction callWith: address with: 0

An off topic question:
I never used FFI, It's possible to make function calls like in the
example shown above, or I must to use the special syntax: <...> ?

Regards,
Diego



More information about the Squeak-dev mailing list