From: Kalle Olavi Niemitalo <tosi@stekt.oulu.fi>
To: guile-emacs@sourceware.cygnus.com
Subject: Re: import-lisp-macro
Date: Mon, 20 Mar 2000 07:50:00 -0000 [thread overview]
Message-ID: <87puspfxy5.fsf@PC486.Niemitalo.LAN> (raw)
In-Reply-To: <m33dppijgl.fsf@kei.cwru.edu>
The current version (emacs.scm 1.3) of import-lisp-macro can't
handle this:
(let ((msg "Hello!"))
(save-excursion
msg))
because it evaluates the lambda in the wrong place.
The following definition seems to work better. I moved most of
the code emitted by the macro to a new function "call-lisp-macro"
because nested backquotes confuse me. There is still some
nesting; I hope I got it right. I am currently unable to access
SourceForge via SSH so please commit this change for me.
(You could use this mail as the log message. :-) )
(define-private (call-lisp-macro macro-name thunk)
(lispref->scm (lisp-eval `(,macro-name
(scheme-eval '(',thunk))))))
(define-macro (import-lisp-macro macro . rest)
(let ((scheme-name (if (pair? rest) (car rest) macro)))
`(define-macro (,scheme-name . body)
`(',',call-lisp-macro ',',macro (lambda () ,@body)))))
(export import-lisp-macro)
next prev parent reply other threads:[~2000-03-20 7:50 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-03-17 9:40 import-lisp-macro Keisuke Nishida
2000-03-18 3:59 ` import-lisp-macro Kalle Olavi Niemitalo
2000-03-18 10:08 ` import-lisp-macro Keisuke Nishida
2000-03-18 10:47 ` import-lisp-macro Keisuke Nishida
2000-03-18 11:00 ` import-lisp-macro Keisuke Nishida
2000-03-20 7:50 ` Kalle Olavi Niemitalo [this message]
2000-03-20 16:04 ` import-lisp-macro Keisuke Nishida
2000-03-21 11:05 ` import-lisp-macro Kalle Olavi Niemitalo
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87puspfxy5.fsf@PC486.Niemitalo.LAN \
--to=tosi@stekt.oulu.fi \
--cc=guile-emacs@sourceware.cygnus.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).