![](https://secure.gravatar.com/avatar/d449d54c3b0f8c9930c11c7d7d3e6cdd.jpg?s=120&d=mm&r=g)
Luís Oliveira <luismbo@gmail.com> writes:
On 2005-dec-18, at 13:25, Surendra Singhi wrote:
Is there any uniform way of passing C null value to functions? Should I pass `0'?
Glad you were able to fix this issue! You should pass (cffi:null- pointer). CLISP does convert NIL to the null pointer which is unfortunate for this reason (Hi Joerg!) :-) And it seems Lispworks does too.
The lack of uniformity is very unfortunate here. This needs to be fixed. We should either a) translate nil->null everywhere, b) don't translate nil->null anywhere or c) offer the two alternatives through two different types.
It will be interesting to know what other lisp implementations like CMUCL, SBCL do? I will vote for clisp's and lispworks approach, it seems least surprising to me. Another related issue is when a C function returns a null pointer. The behavior in that case should be also uniform. Thanks. -- Surendra Singhi http://www.public.asu.edu/~sksinghi/index.html ,---- | "O thou my friend! The prosperity of Crime is like unto the lightning, | whose traitorous brilliancies embellish the atmosphere but for an | instant, in order to hurl into death's very depths the luckless one | they have dazzled." -- Marquis de Sade `----