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


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


Relevant Pages

  • Re: Createing linked forms: "Object is closed or doesnt exist"
    ... a form to a table/query through the form's RecordSource ... C# as well as Oracle's PL/SQL but How do you access bind variables from VBA? ... that forms and macros lock into but I have yet to find this. ... I am mainly an Oracle programmer and now working in Access ...
    (microsoft.public.access.modulesdaovba)
  • Re: ILC2003: ARC
    ... and then call it with (funcall avar params). ... you cannot use Macros in this sense. ... If Macros were first class as functions are you ... instead you could directly bind the Macro and use it exactly as if it ...
    (comp.lang.lisp)