Re: Macro error

2009-02-03 Thread Jeffrey Straszheim
Yes, it was working as a reader macro and messing me up. Using hashmap worked. Thanks. On Feb 3, 8:03 pm, "Stephen C. Gilardi" wrote: > On Feb 3, 2009, at 7:45 PM, Jeffrey Straszheim wrote: > > > Btw, I fixed the ~ needed on relation.  It didn't help.  It seems I > > just can't put a ~@ form i

Re: Macro error

2009-02-03 Thread Stephen C. Gilardi
On Feb 3, 2009, at 7:45 PM, Jeffrey Straszheim wrote: Btw, I fixed the ~ needed on relation. It didn't help. It seems I just can't put a ~@ form inside of a { } set builder. { } reads a literal map. It appears to expect an even number arguments between the curly braces at read time. You c

Re: Macro error

2009-02-03 Thread Timothy Pratley
This works for me: (def wrap-var) (defmacro datalog-term "Builds a term" [relation & formals] (let [wrapped-formals (map wrap-var formals)] `(struct rule ~relation (hash-map ~...@wrapped-formals ie: using (has-map ...) instead of {} I believe this is because {} is handled at the re

Re: Macro error

2009-02-03 Thread Jeffrey Straszheim
Thanks. On Feb 3, 7:55 pm, David Nolen wrote: > {} is a reader macro for hash-map I believe, try something like this: > > (defmacro foobar [& rest] >   `(hash-map ~...@rest)) > > (foobar :first 1 :second 2) > > On Tue, Feb 3, 2009 at 7:45 PM, Jeffrey Straszheim < > > straszheimjeff...@gmail.com>

Re: Macro error

2009-02-03 Thread David Nolen
{} is a reader macro for hash-map I believe, try something like this: (defmacro foobar [& rest] `(hash-map ~...@rest)) (foobar :first 1 :second 2) On Tue, Feb 3, 2009 at 7:45 PM, Jeffrey Straszheim < straszheimjeff...@gmail.com> wrote: > > Btw, I fixed the ~ needed on relation. It didn't hel

Re: Macro error

2009-02-03 Thread Jeffrey Straszheim
Btw, I fixed the ~ needed on relation. It didn't help. It seems I just can't put a ~@ form inside of a { } set builder. On Feb 3, 7:43 pm, Jeffrey Straszheim wrote: > I'm trying to define a macro: > > http://paste.pocoo.org/show/102695/ > > But whenever I try to compile it I get: > > java.lang