Hi,
Am 26.09.2009 um 17:06 schrieb Constantine Vetoshev:
This seems indeed useless at a first glance, but looking down the
cause trace usually shows the real problem.
Full stack trace follows, although I still don't know what it means.
No message.
[Thrown class
Hi,
Am 25.09.2009 um 22:49 schrieb Constantine Vetoshev:
(defmacro def-with-db-macro [macro-name open-fn close-fn]
`(defmacro ~macro-name [[var# open-args#] body#]
`(let [~var# (apply ~'~open-fn [...@open-args#])]
(try
~...@body#
(finally (~'~close-fn ~var#))
On Sep 26, 7:35 am, Meikel Brandmeyer m...@kotka.de wrote:
The problem is, that you quote the symbol you inject into the inner
defmacro. Hence it does not get resolved. The solution in this case
seems to be to syntax-quote the symbol correctly before injection.
Replace the two ~'~ with ~~ and
On Fri, Sep 25, 2009 at 4:49 PM, Constantine Vetoshev
gepar...@gmail.com wrote:
Chris Houser has summarized the problem here more succinctly than I
can: http://paste.lisp.org/display/87734
This is a syntax-quote expansion-timing issue, which is why
Meikel's solutions works. I think it would
(I asked these questions on #clojure, and the friendly locals
suggested I open the question up for a wider audience.)
I'm trying to write a macro-writing-macro. My code has a bunch of
resources which have -open and -close type of calls, and they could
all benefit from with- wrappers. The with-
On Fri, Sep 25, 2009 at 4:49 PM, Constantine Vetoshev gepar...@gmail.comwrote:
(let [f1 #(inc %)]
(defmacro m1 [x]
`(~f1 ~x)))
(m1 12)
= No message.
[Thrown class java.lang.ExceptionInInitializerError]
The equivalent works in Common Lisp (Allegro CL and SBCL):
(let ((f1 (lambda
On Sep 25, 6:02 pm, John Harrop jharrop...@gmail.com wrote:
I don't think you can use things like defmacro in a let.
This works:
(let [y 10]
(defmacro m1 []
`(list ~y)))
(m1) =
(10)
--~--~-~--~~~---~--~~
You received this message because you are
On Fri, Sep 25, 2009 at 8:48 PM, Constantine Vetoshev gepar...@gmail.comwrote:
On Sep 25, 6:02 pm, John Harrop jharrop...@gmail.com wrote:
I don't think you can use things like defmacro in a let.
This works:
(let [y 10]
(defmacro m1 []
`(list ~y)))
(m1) =
(10)
Well, that's