guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Guile Emacs: Elisp nil/t and Guile #nil/#t


From: Ludovic Courtès
Subject: Re: Guile Emacs: Elisp nil/t and Guile #nil/#t
Date: Sat, 17 Aug 2013 14:34:56 +0200
User-agent: Gnus/5.130007 (Ma Gnus v0.7) Emacs/24.3 (gnu/linux)

address@hidden (Taylan Ulrich B.) skribis:

> It occurred to me that nil and t are basically just symbols in Elisp,
> just with some magical properties.  Like any symbol, they respond to
> symbolp, have a plist, value and symbol slot (although the value slot is
> immutable), etc.  They're self-quoting, so 'nil and 't also just return
> nil and t.  Nasty stuff.

Perhaps I’m overlooking something.

To me, it looks like it’s just a matter of binding ‘t’ to #t and ‘nil’
to #nil in the elisp run-time.  This is currently not the case:

--8<---------------cut here---------------start------------->8---
elisp@(guile-user)> nil
$3 = #nil
elisp@(guile-user)> 'nil
$4 = nil
elisp@(guile-user)> t
$5 = #t
elisp@(guile-user)> 't
$6 = t
--8<---------------cut here---------------end--------------->8---

In Scheme, 'nil and 't must remain symbols, though.

In terms of language interoperability, the only thing to have in mind is
that elisp adds the #nil value, which Scheme must be able to interpret
correctly and seamlessly:

--8<---------------cut here---------------start------------->8---
scheme@(guile-user)> (not #nil)
$7 = #t
scheme@(guile-user)> (null? #nil)
$8 = #t
--8<---------------cut here---------------end--------------->8---

HTH,
Ludo’.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]