There's no clever way to cause LOAD to bind vars other than *PACKAGE* and *READTABLE* is there?
From: Peter Seibel (peter_at_javamonkey.com)
Date: 10/23/04
- Next message: mikel: "Re: CMU CL or SBCL on (FreeBSD/)AMD64 any time soon?"
- Previous message: Xavier Maillard: "Re: flushing/draining stdout"
- Next in thread: Pascal Costanza: "Re: There's no clever way to cause LOAD to bind vars other than *PACKAGE* and *READTABLE* is there?"
- Reply: Pascal Costanza: "Re: There's no clever way to cause LOAD to bind vars other than *PACKAGE* and *READTABLE* is there?"
- Reply: Thomas A. Russ: "Re: There's no clever way to cause LOAD to bind vars other than *PACKAGE* and *READTABLE* is there?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 22 Oct 2004 22:08:40 GMT
I'm pretty sure there's no way to do this but I thought I'd ask just
in case:
I'm writing some macros whose behavior can be slightly parameterized
based on some global variables, e.g.
(defmacro html (&body body)
(case *html-syntax*
(:html (generate-html-generator body))
(:xhtml (generate-xhtml-generator body))))
A can easily enough provide a nice way to set *HTML-SYNTAX* wrapped in
the appropriate eval-when foo:
(defmacro using-html-syntax (syntax)
`(eval-when (:compile-top-level :load-top-level :execute)
(setf *html-syntax* ,syntax)))
But this has the problem that a call to USING-HTML-SYNTAX sets it for
everyone, everywhere. So my question is, is there some clever trick
I'm missing to cause LOAD to bind *HTML-SYNTAX* the same way it binds
*PACKAGE* and *READTABLE* so calls to USING-HTML-SYNTAX in one file
don't affect code in other files? Or some other way of achieving the
same affect without wrapping my whole file in a big WITH-HTML-SYNTAX
macro?
-Peter
--
Peter Seibel peter@javamonkey.com
Lisp is the red pill. -- John Fraser, comp.lang.lisp
- Next message: mikel: "Re: CMU CL or SBCL on (FreeBSD/)AMD64 any time soon?"
- Previous message: Xavier Maillard: "Re: flushing/draining stdout"
- Next in thread: Pascal Costanza: "Re: There's no clever way to cause LOAD to bind vars other than *PACKAGE* and *READTABLE* is there?"
- Reply: Pascal Costanza: "Re: There's no clever way to cause LOAD to bind vars other than *PACKAGE* and *READTABLE* is there?"
- Reply: Thomas A. Russ: "Re: There's no clever way to cause LOAD to bind vars other than *PACKAGE* and *READTABLE* is there?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|