[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-hackers] The use of the null-pointer and null-pointer? proc

From: Kon Lovett
Subject: Re: [Chicken-hackers] The use of the null-pointer and null-pointer? procedures
Date: Wed, 11 May 2011 18:29:22 -0700

On May 11, 2011, at 8:14 AM, Peter Bex wrote:

On Wed, May 11, 2011 at 08:21:32AM -0400, Felix wrote:
On Wed, May 11, 2011 at 05:25:12AM -0400, Felix wrote:
I was wondering what use does (null-pointer?) has.

Historical. I will deprecate.

Thanks, Felix.  I noticed the documentation says
"Another way to say (address->pointer 0)". Should the address- >pointer
procedure return #f when given 0?

No, otherwise you couldn't create a pointer object containing a NULL
pointer... :-) I think we can expect a user to be able to code this.

I understand that this wouldn't be possible. But what is the reason
this has to be possible, considering null pointers are represented
as #f everywhere else?  For consistency it would make sense to return
#f here too, but of course you could also argue that it would be more
consistent to always return a pointer...

Possible to apply the #f representation for NULL across all pointer procedures but is this really the problem? The original issue was brought on by the lack of instructive examples in the manual for FFI use.

Suggest leaving lolevel alone and add to the FFI documentation instead.

Ah well

"The process of preparing programs for a digital computer
is especially attractive, not only because it can be economically
and scientifically rewarding, but also because it can be an aesthetic
experience much like composing poetry or music."
                                                        -- Donald Knuth

Chicken-hackers mailing list

reply via email to

[Prev in Thread] Current Thread [Next in Thread]