From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Daniel Kraft Newsgroups: gmane.lisp.guile.devel Subject: Re: %nil once again Date: Fri, 17 Jul 2009 11:02:46 +0200 Message-ID: <4A603E36.7080100@domob.eu> References: <4A5F2F8A.5040108@domob.eu> <8763drbv07.fsf@arudy.ossau.uklinux.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1247821418 21378 80.91.229.12 (17 Jul 2009 09:03:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 17 Jul 2009 09:03:38 +0000 (UTC) Cc: Andy Wingo , guile-devel To: Neil Jerram Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Fri Jul 17 11:03:29 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 1MRjLi-0006Cv-6F for guile-devel@m.gmane.org; Fri, 17 Jul 2009 11:03:27 +0200 Original-Received: from localhost ([127.0.0.1]:49821 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MRjLh-0003TU-Kg for guile-devel@m.gmane.org; Fri, 17 Jul 2009 05:03:25 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MRjKp-0002F3-DN for guile-devel@gnu.org; Fri, 17 Jul 2009 05:02:31 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MRjKk-00026M-Jv for guile-devel@gnu.org; Fri, 17 Jul 2009 05:02:30 -0400 Original-Received: from [199.232.76.173] (port=50410 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MRjKj-00025p-Th for guile-devel@gnu.org; Fri, 17 Jul 2009 05:02:25 -0400 Original-Received: from taro.utanet.at ([213.90.36.45]:34230) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MRjKj-0006wv-5U for guile-devel@gnu.org; Fri, 17 Jul 2009 05:02:25 -0400 Original-Received: from paris.xoc.tele2net.at ([213.90.36.7]) by taro.utanet.at with esmtp (Exim 4.69) (envelope-from ) id 1MRjKd-00013w-MI; Fri, 17 Jul 2009 11:02:19 +0200 Original-Received: from d86-33-51-77.cust.tele2.at ([86.33.51.77] helo=[192.168.1.18]) by paris.xoc.tele2net.at with esmtpa (Exim 4.69) (envelope-from ) id 1MRjKd-00046G-CO; Fri, 17 Jul 2009 11:02:19 +0200 User-Agent: Thunderbird 2.0.0.0 (X11/20070425) In-Reply-To: <8763drbv07.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:8884 Archived-At: Hi Neil, Neil Jerram wrote: > Daniel Kraft writes: >> I think I got the test-suite as well as a basic macro implementation >> (the compiler framework is really cool, that was fairly easy to do); >> recursive macros do not yet work, but otherwise it looks fine. >> >> However, I want to tackle quasi-quotes (besides others) now; and in >> Elisp %nil is not only #f of Scheme but also the end-of-list marker (I >> guess that's why simply using Scheme's #f for %nil does not work). >> >> I did some experiments, and it seems that Scheme respects it partially: >> >> scheme@(guile-user)> `(1 2 3 . ,%nil) >> (1 2 3) >> >> (is %nil in Scheme a variable because it needs the unquote?) > > Do you mean why don't we just use the symbol nil? If so, the answer > is because in Scheme, (cons 'a 'nil) should be (a . nil), not (a). No, I mean why '(1 2 3 . %nil) does yield (1 2 3 . %nil) while `(1 2 3 . ,%nil) gives the expected (1 2 3). But that does not matter much besides astonishing me, as this is only something related to the Scheme implementation of %nil, I guess. >> However: >> >> scheme@(guile-user)> (null? %nil) >> #f >> scheme@(guile-user)> (equal? %nil (cdr (list 1))) >> #f > > I believe those work in the interpreter, and so are VM bugs. Can you > check that with ,o interp #t ? The first one is indeed #t with the interpreter, the second one not. But unfortunatly I think that the elisp equivalent of (equal?/eqv?/eq? (cdr (list 1)) nil) (don't know which predicates take the place of eq?/eqv?/equal? in elisp yet) should indeed yield true, as a perfectly valid way to check for (null? (cdr (list 1))), right? So it seems that in this case even the Guile interpreter does not handle empty lists as it should for elisp -- or don't we need to ensure that test is true? >> Or could we introduce some means to do so? >> >> If that's not a good idea because of performance or other >> considerations, I guess I'll have to implement some conversion routine >> and use that? This on the other hand will probably hit Elisp's >> performance. >> >> Any suggestions and ideas welcome! Maybe I just fail to see something... > > Just a couple of VM bugs, I think... Hm, ok, so if the one thing above is resolved (or can be ignored) I can without any problems just use Guile's primitive list and co. and take created lists as valid for Elisp, as long as those bug get fixed (maybe with the pending patch)? So no need for ensuring myself that all '()'s get replaced by %nil's? Daniel -- Done: Arc-Bar-Cav-Ran-Rog-Sam-Tou-Val-Wiz To go: Hea-Kni-Mon-Pri