[Ecls-list] Wrapping C++ constants...

Matthew Mondor mm_lists at pulsar-zone.net
Thu Jul 11 15:35:18 UTC 2013


On Thu, 11 Jul 2013 20:26:11 +0900
Dietrich Bollmann <dietrich at formgames.org> wrote:

> I want to wrap a pointer to a C++ constant into a lisp constant.
> 
> The following
> 
>   (defconstant +xy-plane+
>     (ffi:c-inline () () :pointer-void "(void *) &ON_xy_plane" :one-liner t))
> 
> results in this error:
[...]
> 
> But this - at least to me - looks kind of unnecessarily cumbersome...
> 
> Is there a better way to wrap a pointer to a constant from lisp?

It's necessary to wrap those DEFCONSTANT inside a LET block so they are
no longer top-level, see how contrib/sockets/sockets.lisp in the ECL
source tree does it for instance.
-- 
Matt




More information about the ecl-devel mailing list