It Seemed Like a Good Idea at the Time Coding, Mostly

19Dec/080

Whoo! Callbacks!

SoLoad now has support for user-defined callback functions.

The syntax goes

cbnew rtype atypes

to create a new callback function.  The value returned from this command will always be used when the callback is invoked in the execution of another SoLoad command, so hang onto it.

When the callback is invoked, it will return a message in the form of

callback callbackID arg1 ... argN

instead of a normal function return.

If you want to delete the callback, simply go

cbdel callbackID

but as always, if you don't bother, it will be cleaned up at exit.

Other Changes in SoLoad

The "load" and "type" commands no longer require you to explicitly state the number of types they take.  Support for giving referring to libraries, functions, and such by name was removed, as it complicated the program a great deal, and didn't really help at all when SoLoad was invoked from another program.  Support for loadable definition files was axed too, with the realization that the information would generally be repeated the language-side bindings anyway, so the functions might as well be loaded dynamically there too.

Unfortunately, these changes mean that my old guides are now subtly inaccurate.  I will add a note to that effect later, but will hesitate to write new documentation until I am reasonably sure the interface won't be changing for a while.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)
Comments (0) Trackbacks (0)

No comments yet.


Leave a comment


No trackbacks yet.