From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mark H Weaver Newsgroups: gmane.lisp.guile.devel Subject: Re: truth of %nil Date: Wed, 2 Sep 2009 11:57:27 -0400 Message-ID: <20090902155727.GA3310@fibril.netris.org> 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> <87r5uqnx4c.fsf@arudy.ossau.uklinux.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1251907477 26427 80.91.229.12 (2 Sep 2009 16:04:37 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 2 Sep 2009 16:04:37 +0000 (UTC) Cc: Andy Wingo , Daniel Kraft , guile-devel To: Neil Jerram Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Wed Sep 02 18:04:31 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 1MisJx-0000fu-WC for guile-devel@m.gmane.org; Wed, 02 Sep 2009 18:04:30 +0200 Original-Received: from localhost ([127.0.0.1]:53885 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MisJx-0001UF-GB for guile-devel@m.gmane.org; Wed, 02 Sep 2009 12:04:29 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MisDR-00058B-E9 for guile-devel@gnu.org; Wed, 02 Sep 2009 11:57:45 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MisDM-00054S-Ic for guile-devel@gnu.org; Wed, 02 Sep 2009 11:57:44 -0400 Original-Received: from [199.232.76.173] (port=34487 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MisDM-00054L-Fl for guile-devel@gnu.org; Wed, 02 Sep 2009 11:57:40 -0400 Original-Received: from world.peace.net ([204.107.200.8]:38256) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MisDM-00054B-3p for guile-devel@gnu.org; Wed, 02 Sep 2009 11:57:40 -0400 Original-Received: from localhost ([127.0.0.1] helo=fibril.netris.org ident=hope9) by world.peace.net with esmtp (Exim 4.69) (envelope-from ) id 1MisDC-0002cR-P2; Wed, 02 Sep 2009 11:57:30 -0400 Content-Disposition: inline In-Reply-To: <87r5uqnx4c.fsf@arudy.ossau.uklinux.net> X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) 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:9250 Archived-At: Neil Jerram wrote: > > 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. Certainly writing (a b c . #nil) as (a b c) would be most natural and convenient, and maybe it's the best compromise, but I'm not entirely sure it's safe. What if we have an association list mapping symbols to booleans that came from elisp? Such a alist might look something like ((a . #t) (b . #nil)), and can reasonably be assumed to be written and then read back in, but doing so would then result in ((a . #t) (b . ())), magically changing the false to a true. This also violates the idea the CARs and CDRs should be treated the same way. I'm tempted to suggest that "write" should write (a . #nil) as "(a . #nil)", and "display" should write it as "(a)". Best, Mark