For Programmers: Free Programming Magazines  


Home > Archive > Lisp > September 2004 > Re: The Lisp-Difference









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: The Lisp-Difference
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
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2009 codecomments.com