From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Neil Jerram Newsgroups: gmane.lisp.guile.devel Subject: Re: truth of %nil Date: Tue, 01 Sep 2009 23:00:51 +0100 Message-ID: <87r5uqnx4c.fsf@arudy.ossau.uklinux.net> References: <87k52uvhnt.fsf@arudy.ossau.uklinux.net> <873a9hl5uf.fsf@arudy.ossau.uklinux.net> <4A4B0619.5070006@domob.eu> <87ljn8rrv9.fsf@arudy.ossau.uklinux.net> <20090705130725.GA2021@fibril.netris.org> <87my5hy2yv.fsf@arudy.ossau.uklinux.net> <20090830141100.GA2255@fibril.netris.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1251842484 11294 80.91.229.12 (1 Sep 2009 22:01:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 1 Sep 2009 22:01:24 +0000 (UTC) Cc: Andy Wingo , Daniel Kraft , guile-devel To: Mark H Weaver Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Wed Sep 02 00:01:16 2009 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MibPg-00084C-2T for guile-devel@m.gmane.org; Wed, 02 Sep 2009 00:01:16 +0200 Original-Received: from localhost ([127.0.0.1]:44091 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MibPf-0005yL-Ha for guile-devel@m.gmane.org; Tue, 01 Sep 2009 18:01:15 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MibPP-0005ac-OS for guile-devel@gnu.org; Tue, 01 Sep 2009 18:00:59 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MibPK-0005SK-5F for guile-devel@gnu.org; Tue, 01 Sep 2009 18:00:59 -0400 Original-Received: from [199.232.76.173] (port=45503 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MibPJ-0005SH-Vo for guile-devel@gnu.org; Tue, 01 Sep 2009 18:00:53 -0400 Original-Received: from mail3.uklinux.net ([80.84.72.33]:36302) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MibPJ-0001LN-2n for guile-devel@gnu.org; Tue, 01 Sep 2009 18:00:53 -0400 Original-Received: from arudy (host86-152-99-133.range86-152.btcentralplus.com [86.152.99.133]) by mail3.uklinux.net (Postfix) with ESMTP id 1FCBB1F6652; Tue, 1 Sep 2009 23:00:52 +0100 (BST) Original-Received: from arudy.ossau.uklinux.net (arudy [127.0.0.1]) by arudy (Postfix) with ESMTP id 45BB038021; Tue, 1 Sep 2009 23:00:51 +0100 (BST) In-Reply-To: <20090830141100.GA2255@fibril.netris.org> (Mark H. Weaver's message of "Sun\, 30 Aug 2009 10\:11\:00 -0400") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.4-2.6 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:9242 Archived-At: Mark H Weaver writes: > What about scm_is_bool? I'm tempted to suggest that it should work > the same way as "boolean?" within scheme, whatever that may be. I > tend to think they ought to treat %nil as boolean, though I'm less > sure of this than about scm_is_true/false/null. It's the right thing > for type-checking an argument that is expected to be boolean, which > seems to be fairly common in guile. More complex code that is > dispatching on type (such as the aforementioned GOOPS code) will in > general have to be fixed to take into account that %nil is both a > boolean and a list. I agree (i.e. I think scm_is_bool (SCM_LISP_NIL) should be 1). > One more thing: scheme code can reasonably expect to "write" a list of > simple values and then "read" it back in. But now, lists might be > terminated by %nil instead of '(). Therefore, I think "read" needs to > be able to read SCM_LISP_NIL in whatever form we "write" it in. I'll > let someone more knowledgable about guile reader issues decide what > that form should be. Currently we write it as "#nil". Interesting point, but seems like one that could be left until it crops up for real somewhere. I assume the mainline case of writing a proper list will be fine, because a list like (a b c . #nil) will be written out as "(a b c)" - right? Then, when read in again, it would become (a b c . ()) - I think we may have to wait for real cases to know if that's actually a problem at all. > Yes, I've also given this some thought. If we were using C++ (I'm > very glad we're not, btw!) then I'm pretty sure we could use the type > system to mark certain functions as never returning %nil, and then > arrange to optimize away the %nil checks in those cases, but I can't > think of a way to do it with C, even with GCC's extensions. Maybe, if > we can develop a reasonable proposal, we can get sufficient > functionality added to GCC. I was actually meaning the VM compiler... but yes, maybe there are also C things we could do. >> So, if you would be happy to do so, can I suggest that you rework your >> patches so that they also make (and then assume, obviously) the >> scm_is_false/true/bool/null change, and incorporate my other comments? > > I will gladly do so. Fantastic, thanks (and also for your 'Yes's to the other add-on pieces)! > Also, I signed my copyright assignment papers a while ago, and the > relevant file on fencepost has been updated accordingly. Yes, indeed; we (maintainers) got notified about that at the time; apologies for not closing the loop with you then. Regards, Neil