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: Wed, 01 Jul 2009 22:54:50 +0100 Message-ID: <87ljn8rrv9.fsf@arudy.ossau.uklinux.net> References: <87k52uvhnt.fsf@arudy.ossau.uklinux.net> <873a9hl5uf.fsf@arudy.ossau.uklinux.net> <4A4B0619.5070006@domob.eu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1246485314 8455 80.91.229.12 (1 Jul 2009 21:55:14 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 1 Jul 2009 21:55:14 +0000 (UTC) Cc: Andy Wingo , guile-devel To: Daniel Kraft Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Wed Jul 01 23:55:07 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 1MM7lh-0008K1-Ei for guile-devel@m.gmane.org; Wed, 01 Jul 2009 23:55:05 +0200 Original-Received: from localhost ([127.0.0.1]:33402 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MM7lh-0005SF-13 for guile-devel@m.gmane.org; Wed, 01 Jul 2009 17:55:05 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MM7lc-0005SA-1B for guile-devel@gnu.org; Wed, 01 Jul 2009 17:55:00 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MM7lW-0005Rx-Fs for guile-devel@gnu.org; Wed, 01 Jul 2009 17:54:58 -0400 Original-Received: from [199.232.76.173] (port=36307 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MM7lW-0005Ru-AE for guile-devel@gnu.org; Wed, 01 Jul 2009 17:54:54 -0400 Original-Received: from mail3.uklinux.net ([80.84.72.33]:44932) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MM7lV-0001J8-QN for guile-devel@gnu.org; Wed, 01 Jul 2009 17:54:54 -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 0A7B41F7086; Wed, 1 Jul 2009 22:54:52 +0100 (BST) Original-Received: from arudy.ossau.uklinux.net (arudy [127.0.0.1]) by arudy (Postfix) with ESMTP id AB27438021; Wed, 1 Jul 2009 22:54:50 +0100 (BST) In-Reply-To: <4A4B0619.5070006@domob.eu> (Daniel Kraft's message of "Wed\, 01 Jul 2009 08\:45\:45 +0200") 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:8817 Archived-At: Daniel Kraft writes: > it seems so. Doing just a > > scheme@(guile-user)> (if %nil 1 2) > 1 > > with a recent build (of at least my elisp branch, but that did not > change anything in this respect of course) gives that answer. > > Doing ,o interp #t as Andy did however also gives the right answer for > me. BTW, I've just changed my elisp compiler to use real nil instead > of #f for nil, but now it doesn't have the right semantics of course > (that's the motivation here). OK, I see. The point is that VM ops like br-if use SCM_FALSEP (which is equivalent to scm_is_false), and hence you're wondering if it would be easier to change the definition of scm_is_false, than to modify those ops to say (SCM_FALSEP (x) || SCM_NILP (x)). I think the balance of arguments is clearly against doing that: - There are lots of places that use scm_is_false where there is no need to allow for the value being tested being %nil. Changing scm_is_false would be a performance hit for those places. - There are only a handful of places (I think) that you need to change to get %nil-falseness in the VM. - There is a similar number of places which already implement %nil-falseness in the interpreter by using (scm_is_false (x) || SCM_NILP (x)), and these would logically have to be changed if you made your proposed change. - It would be an incompatible API change. So please just change the relevant places in the VM to say (scm_is_false (x) || SCM_NILP (x)) instead. Regards, Neil