From: Sam S. <sd...@gn...> - 2003-08-01 15:18:22
|
> * In message <9F8582E37B2EE5498E76392AEDDCD3FE05C97186@G8PQD.blf01.telekom.de> > * On the subject of "FFI crash: what am I missing?!" > * Sent on Fri, 1 Aug 2003 11:27:17 +0200 > * Honorable "Hoehle, Joerg-Cyril" <Joe...@t-...> writes: > > Sam wondered what he missed: > ... The obvious from http://norsys.com/onLineAPIManual/index.html > "mesg should be a pointer to a character array > which is allocated at least MESG_LEN_ns characters long." > (mesg (c-ptr (c-array character 12345-or-whatever)) :out) Jorg, thank you very much!! > BTW2, if you declared the second parameter to new_netica as c-string > (which is not it's type, it's environ_ns) just so that you can easily > supply NULL, other people have succesfully used NIL as a type > declaration, even though impnotes says it's output only. but I won't be able to pass anything but NIL there, right? > >1. why can't I pass NIL as a C-POINTER and have CLISP use NULL?! > It would be possible to add such polymorphism, but I'm not much in > favour of such things unless the behaviour can be made symmetric. > > So the question becomes: what happens the other way round (e.g. as > :return-type or as return from FOREIGN-VALUE)? > > 1b. What should be the value of conversion from C-POINTER when the > foreign pointer happens to be NULL? Up to now, it is an object equalp > to #<FOREIGN-ADDRESS 00000000>. very interesting and enlightening discussion. what do other FFIs do here? CMUCL? ACL? LW? what behavior does UFFI expect? -- Sam Steingold (http://www.podval.org/~sds) running w2k <http://www.camera.org> <http://www.iris.org.il> <http://www.memri.org/> <http://www.mideasttruth.com/> <http://www.palestine-central.com/links.html> The difference between genius and stupidity is that genius has its limits. |