unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* %nil once again
@ 2009-07-16 13:47 Daniel Kraft
  2009-07-17  7:59 ` Neil Jerram
                   ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Daniel Kraft @ 2009-07-16 13:47 UTC (permalink / raw)
  To: guile-devel; +Cc: Andy Wingo, Neil Jerram

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).

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?)

However:

scheme@(guile-user)> (null? %nil)
#f
scheme@(guile-user)> (equal? %nil (cdr (list 1)))
#f

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.

So:  How is this handled by the interpreter?  Is there maybe some 
runtime-option to make Guile use %nil as end-of-list for lists 
constructed?  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...

Thanks,
Daniel

-- 
Done:  Arc-Bar-Cav-Ran-Rog-Sam-Tou-Val-Wiz
To go: Hea-Kni-Mon-Pri




^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2009-07-31  5:05 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

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).