From: Cyrus H. <ch...@bo...> - 2005-08-16 04:10:51
|
[I'm sending this to sbcl-devel rather than sbcl-help as callbacks are a new feature and probably still under development] I'm trying to define a lisp function that returns no arguments and find that I can't seem to do so: (defun round-trip-fun1 (a) (+ a 1)) ;;; this works (at least the declaration works, haven't tried the ;;; callback yet) (defparameter *round-trip* (sb-alien::alien-callback (sb-alien:function sb-alien:int (* sb-alien:int)) #'round-trip-fun1)) (defun round-trip-fun2 (a) (print a) (values)) ;;; but this fails with the message below (defparameter *round-trip* (sb-alien::alien-callback (sb-alien:function sb-alien:void (* sb-alien:int)) #'round-trip-fun2)) (in macroexpansion of (SB-ALIEN-INTERNALS:ALIEN-CALLBACK # #)) (hint: For more precise location, try *BREAK-ON-SIGNALS*.) cannot use values types here I know this may seem like an artificial example, but I have some (admittedly contrived) C code that takes a callback to a function that takes one argument and is of return type void. I'd like to implement this callback in lisp, but I can't seem to figure out how. Thanks, Cyrus |