From: Clinton Ebadi <clinton@unknownlamer.org>
To: Daniel Kraft <d@domob.eu>
Cc: Andy Wingo <wingo@pobox.com>,
Neil Jerram <neil@ossau.uklinux.net>,
guile-devel <guile-devel@gnu.org>
Subject: Re: %nil once again
Date: Mon, 20 Jul 2009 14:17:28 -0400 [thread overview]
Message-ID: <87ws63md6v.fsf@unknownlamer.org> (raw)
In-Reply-To: <4A5F2F8A.5040108@domob.eu> (Daniel Kraft's message of "Thu, 16 Jul 2009 15:47:54 +0200")
Daniel Kraft <d@domob.eu> writes:
> Hi,
>
> 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).
[...]
> It would be cool to teach Guile somehow to treat %nil as the
> "standard" end-of-list value, such that both of these queries would
> optimally return true. At least, is there some way to construct lists
> terminated by %nil using something like the list primitive? Other
> things needed would be for instance terminating rest-arguments by %nil
> rather than '() and the like.
Why not eliminate %nil/#nil and replace it with ... '(). This would
allow elisp to reuse all (or at least most) of the Scheme list functions
without having to muddy Scheme semantics with special #f/#nil handling,
but would require a very tiny elisp specific truth predicate. Since
everything should be compiled into an IL instead of Scheme this should
be straightforward. This would have the rather nice advantage of
removing all special elisp support code from libguile itself (thus
cleaning up libguile a bit *and* making the elisp translator a much
better example for other language translators since every language can't
expect to have special support from libguile).
If the Scheme value #f leaked into an elisp lisp/vector/etc. then it
should *not* be treated as false to elisp because it is *not* an elisp
false value; likewise if '() leaks back into data used by Scheme there
is no particular reason to treat that as false and not end of list.
This has the slight downside that calling between elisp and Scheme may
not be so natural. Any elisp that would call Scheme must know it is
calling Scheme (or simply not-elisp) and that it ought to generate
Scheme false objects if it is calling a predicate of some sort, and any
Scheme calling elisp should know this and use null? to check for a false
return value. The only downside I can see to this is that if code were
to be ported from elisp to Scheme there would now be code that assumed a
'() return as false when #f would be false, but this could be fixed
using a predicate like elisp-false? (or null-or-false? or
... something).
Having multiple distinct false values is almost as bad as punning false
and end of list and so I think the few disadvantages do not outweigh the
advantages.
--
Leebert: You don't listen to music.
Leebert: You listen to the audio equivalent of /dev/urandom
next prev parent reply other threads:[~2009-07-20 18:17 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
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 [this message]
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=87ws63md6v.fsf@unknownlamer.org \
--to=clinton@unknownlamer.org \
--cc=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).