Hi,
On 2 Feb., 08:44, Ken Wesson kwess...@gmail.com wrote:
This also means that macros should not use list? to test whether an
object is a nonatomic s-expression. Unfortunately core doesn't contain
a compact test for atomicity; to get all the list-y things that print
as (foo bar baz ...) you
Thanks. That is indeed what fixed it!
And macroexpand (and pr in general) should have an option to mark what is a
list and what is a cons thingy. That is confusing.
On Feb 2, 2011, at 1:48 AM, George Jahad wrote:
As usual, Meikel has the right answer. But I didn't quite get it at
first.
On Wed, Feb 2, 2011 at 3:22 AM, Meikel Brandmeyer m...@kotka.de wrote:
Hi,
On 2 Feb., 08:44, Ken Wesson kwess...@gmail.com wrote:
This also means that macros should not use list? to test whether an
object is a nonatomic s-expression. Unfortunately core doesn't contain
a compact test for
So, I have a macro that looks something like this:
(defmacro test-failure
[ forms]
`(handler-case :type
~@forms
(~'handle :error/error
(println error happened
(My real macro is more complex, but this gives the idea.)
If I eval
(test-failure (println test))
I get:
If I remember right from looking at clojure.contrib.condition's source
(which I did because I wrote a similar error handling lib, which has a
few extra features but isn't ready for prime time)...
handle doesn't actually exist as a function or macro. It doesn't
expand - the handler-case macro
Hi,
the failing part is actually not the comparison of the symbols, but the check
for listness.
user= (list? (nth `(handler-case :type (println test) (~'handle foo)) 3))
false
user= (seq? (nth `(handler-case :type (println test) (~'handle foo)) 3))
true
Sincerely
Meikel
--
You received this
As usual, Meikel has the right answer. But I didn't quite get it at
first.
It looks like syntax-quote generates cons's, not lists:
user (type (nth `(handler-case :type (println test) (~'handle foo))
3))
clojure.lang.Cons
Your macroexpand-1 example worked because the reader doesn't
distinguish
On Wed, Feb 2, 2011 at 1:48 AM, George Jahad
cloj...@blackbirdsystems.net wrote:
As usual, Meikel has the right answer. But I didn't quite get it at
first.
It looks like syntax-quote generates cons's, not lists:
user (type (nth `(handler-case :type (println test) (~'handle foo))
3))