| Peter Seibel 2004-09-28, 4:00 am |
| rpw3@rpw3.org (Rob Warnock) writes:
> or even something like this [for SQL fans]:
>
> (defun foo (x)
> (declare (transactional "ISOLATION LEVEL SERIALIZABLE")
> ...code...)
>
> so that, as someone else noted, you could have a compiler macro
> for FOO that reached in, parsed the declaration, and rewrote the
> function, perhaps into this:
>
> (defun foo (x)
> (with-transaction (:isolation-level :serializable)
> ...code...))
Uh, I'm not sure how a compiler macro is going to help--it's not going
to see the definition of FOO, it's going to see the call to FOO, no?
Seems more like you'd need to shadow DEFUN. But at that point you
don't need to declare your declaration because the declaration is just
data to your macro that will, presumably, never be seen by the
compiler.
-Peter
--
Peter Seibel peter@javamonkey.com
Lisp is the red pill. -- John Fraser, comp.lang.lisp
|