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: Sun, 19 Jul 2009 21:44:14 +0200 Message-ID: <4A63778E.3010109@domob.eu> References: <4A5F2F8A.5040108@domob.eu> <8763drbv07.fsf@arudy.ossau.uklinux.net> <4A603E36.7080100@domob.eu> <87ab30bk8p.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 1248032657 29463 80.91.229.12 (19 Jul 2009 19:44:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 19 Jul 2009 19:44:17 +0000 (UTC) Cc: Andy Wingo , guile-devel To: Neil Jerram Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sun Jul 19 21:44:10 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 1MScIh-0002n6-Pr for guile-devel@m.gmane.org; Sun, 19 Jul 2009 21:44:00 +0200 Original-Received: from localhost ([127.0.0.1]:47765 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MScIg-0007a6-Mu for guile-devel@m.gmane.org; Sun, 19 Jul 2009 15:43:58 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MScId-0007ZT-Q7 for guile-devel@gnu.org; Sun, 19 Jul 2009 15:43:55 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MScIZ-0007Rj-1Y for guile-devel@gnu.org; Sun, 19 Jul 2009 15:43:55 -0400 Original-Received: from [199.232.76.173] (port=51711 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MScIY-0007Rb-Ty for guile-devel@gnu.org; Sun, 19 Jul 2009 15:43:50 -0400 Original-Received: from tatiana.utanet.at ([213.90.36.46]:42365) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MScIY-0008UA-8E for guile-devel@gnu.org; Sun, 19 Jul 2009 15:43:50 -0400 Original-Received: from pam.xoc.tele2net.at ([213.90.36.6]) by tatiana.utanet.at with esmtp (Exim 4.69) (envelope-from ) id 1MScIS-0006CI-MC; Sun, 19 Jul 2009 21:43:44 +0200 Original-Received: from d91-128-23-111.cust.tele2.at ([91.128.23.111] helo=[192.168.1.18]) by pam.xoc.tele2net.at with esmtpa (Exim 4.69) (envelope-from ) id 1MScIS-0001P8-He; Sun, 19 Jul 2009 21:43:44 +0200 User-Agent: Thunderbird 2.0.0.0 (X11/20070425) In-Reply-To: <87ab30bk8p.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:8890 Archived-At: Hi Neil, Neil Jerram wrote: > Daniel Kraft writes: > >>>> 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? > > Hm, interesting point. Is it a problem in practice though? If so, > what is the practical context? > > i.e. is there a lot of existing code that uses (equal ... nil) to test > for the end of a list, rather than (null ...) ? honestly, I don't know (but think in practice null shoud be used). >> So no need for ensuring myself that >> all '()'s get replaced by %nil's? > > I would say not - because much of the existing Scheme/Elisp design is > based on _not_ having to translate data as it passes between > languages. Good, that sounds reasonable and is also what I suggest. If we are one day able to actually run existing elisp code through Guile, we'll find out if anything needs to be changed in order to get a usable implementation anyways. BTW, I implemented also the function bindings of symbols using this fluid-based dynamic scoping at the moment -- but on second thought, there's no scoping at all for function slots (all are global), is there? If this is true, we can get rid of this complication here and use the symbols in (language elisp runtime function-slot) directly without indirection via the fluids. Yours, Daniel PS: Current status update (should mainly be pushed already): Yesterday I implemented compiler handling of backquoting and a lot of new built-ins (mainly list stuff like cons, car/cdr or number-sequence). Currently I'm working on some "derived" control-structures (prog1, prog2, when, unless, dotimes, dolist), and then a lot of the basic stuff will already be in place. However, there isn't yet a real elisp-reader, so maybe this is the next big project (but I can try to make use of the existing patches). -- Done: Arc-Bar-Cav-Ran-Rog-Sam-Tou-Val-Wiz To go: Hea-Kni-Mon-Pri