On Sat, 23 Apr 2005, John Morrison wrote:
> (1) Sometimes the unmangled C++ function names collide with Lisp ones
> (e.g., atan, atanh, etc.). Should I put the set of
> define-alien-routine forms into a new package, so that collisions are
> avoided? Is this supported in sb-alien?
Yes and yes.
(define-alien-routine my-package:foo ...)
should do the right thing.
> (2) Sometimes, there are C++ overloaded functions (e.g., atan) that
> are differentiated only by their argument types, wherein the unmangled
> names collide (although they have unique mangled names). Does anybody
> have any stylistic suggestions for how to make this as elegant as
> possible?
I'm not sure what you're after, but maybe something like this is what
you're after?
(declaim (inline foo))
(defun foo (x y)
(etypecase x
(integer
(etypecase y
(integer
(foo-int-int x y))
(single-float
(foo-int-float x y)))
....
Cheers,
-- Nikodemus Schemer: "Buddha is small, clean, and serious."
Lispnik: "Buddha is big, has hairy armpits, and laughs."
|