Question re. Call-by-value for foreign structs

paul tarvydas paultarvydas at gmail.com
Fri Dec 7 14:05:12 UTC 2018


Using CFFI, do I need to specify translation methods when performing call-by-value to C?

I am assuming (possibly incorrectly?) that cffi:defcstruct will create the translations for a C struct for me, then pass that struct by value to a Go foreign routine.

Specifically, I am trying to call routines in Go from Lisp using a Lisp string.

A Go string is a C struct { pointer-to-string , integer-length-of-string }

Simple test code is in https://github.com/guitarvydas/lisp-go/blob/master/string-example/lisp-client.lisp.

(see function "my-log", run "make" which should build and run the example, causing a NO-APPLICABLE-METHOD-ERROR).

thanks
pt




More information about the cffi-devel mailing list