[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
Re: [Chicken-hackers] The use of the null-pointer and null-pointer? procedures
Thu, 12 May 2011 03:59:30 -0400 (EDT)
From: Peter Bex <address@hidden>
Subject: Re: [Chicken-hackers] The use of the null-pointer and null-pointer?
Date: Wed, 11 May 2011 17:14:15 +0200
> 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...
It's a low-level routine. For some reasons a user might want to create
a pointer object containing 0 bits. This stuff is nort needed by the FFI,
and AFACIT only there the NULL == #f idiom exists.