Thinking more deeply on this, I think
(i) DEFINE-ALIEN-FUNCTION as DEFINE-ALIEN-ROUTINE replacement is really
the way to go, becauce then we can sanely support documentation (we
currently do, but it is not very nice and undocumented to boot),
non-globally loaded shared objects, and multiple foreign calling
So something like
macro DEFINE-ALIEN-ROUTINE name return-type typed-lambda-list
&key documentation shared-object calling-convention
would seem straightforward. Almost, if not for...
(ii) DEFINE-ALIEN-CALLBACK (or whatever we call it) should also support
multiple calling conventions. Unfortunately since there we have the
body trailing the lamdba-list we cannot attach arbitrary &keys nicely:
macro DEFINE-ALIEN-CALLBACK name return-type typed-lambda-list
...and I would really like to keep these two interfaces as similar as
macro DEFINE-ALIEN-FUNCTION name [calling-convention] return-type
typed-lambda-list &key shared-object documentation
macro DEFINE-ALIEN-CALLBACK name [calling-convention] return-type
typed-lambda-list &body forms
where [calling-convention] is an optional keyword denoting a supported
calling convention, defaulting to :default, which is the platform
If this worrying about calling conventions seems premature, I should say
that I'm seriously considering a Windows port -- seriously enough that
I'm getting a box for it next week -- and it seem to me that support
for both stdcall and ccall are needed sooner or later anyways.
-- Nikodemus Schemer: "Buddha is small, clean, and serious."
Lispnik: "Buddha is big, has hairy armpits, and laughs."