Hi,

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:

  ;;; Error:
  ;;;   in file rhino-lisp-api.lisp, position 7235
  ;;;   at (DEFCONSTANT +xy-plane+  ...)
  ;;;   * The form (PROGN (SI:*MAKE-CONSTANT '+xy-plane+  (FFI:C-INLINE NIL
NIL :POINTER-VOID "(void *) &ON_xy_plane" :ONE-LINER T))
(SI::REGISTER-GLOBAL '+xy-plane+ )) was not evaluated successfully.
  ;;; Error detected:
  ;;; The special form c-inline cannot be used in the interpreter: (NIL NIL
POINTER-VOID (void *) &ON_xy_plane ONE-LINER T)An error occurred during
initialization:
  COMPILE-FILE-ERROR while
  compiling #<cl-source-file "rhino-lisp-api" "rhino-lisp-api">.
  NMAKE : fatal error U1077:
'C:\Users\dietrich\home\cs\lang\lisp\ecl\64\git\install\ecl.exe' : return
code '0x1'
  Stop.

So I am currently using a function

  (defun get-xy-plane ()
    (ffi:c-inline () () :pointer-void "(void *) &ON_xy_plane" :one-liner t))

and later

  (defconstant +xy-plane+ (get-xy-plane))

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?

Thanks,
Dietrich
------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
Ecls-list mailing list
Ecls-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ecls-list

Reply via email to