unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Daniel Kraft <d@domob.eu>
To: Neil Jerram <neil@ossau.uklinux.net>
Cc: Andy Wingo <wingo@pobox.com>, guile-devel <guile-devel@gnu.org>
Subject: Re: %nil once again
Date: Sun, 19 Jul 2009 21:44:14 +0200	[thread overview]
Message-ID: <4A63778E.3010109@domob.eu> (raw)
In-Reply-To: <87ab30bk8p.fsf@arudy.ossau.uklinux.net>

Hi Neil,

Neil Jerram wrote:
> Daniel Kraft <d@domob.eu> 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




  reply	other threads:[~2009-07-19 19:44 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-16 13:47 %nil once again Daniel Kraft
2009-07-17  7:59 ` Neil Jerram
2009-07-17  9:02   ` Daniel Kraft
2009-07-17 14:20     ` Andreas Rottmann
2009-07-19 18:28     ` Neil Jerram
2009-07-19 19:44       ` Daniel Kraft [this message]
2009-07-19 20:10         ` Neil Jerram
2009-07-20  3:33           ` Ken Raeburn
2009-07-20  8:12             ` Daniel Kraft
2009-07-20  9:15               ` Ken Raeburn
2009-07-23 22:18             ` Andy Wingo
2009-07-20 18:17 ` Clinton Ebadi
2009-07-30 21:38   ` Neil Jerram
2009-07-31  5:03     ` Daniel Kraft
2009-07-23 20:35 ` Andy Wingo
2009-07-24  6:20   ` Daniel Kraft
2009-07-30 21:50   ` Neil Jerram
2009-07-31  5:05     ` Daniel Kraft

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A63778E.3010109@domob.eu \
    --to=d@domob.eu \
    --cc=guile-devel@gnu.org \
    --cc=neil@ossau.uklinux.net \
    --cc=wingo@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).