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 reader level to specify
a hash-map, not create one (excuse my inaccurate terminology).
> just can't put a ~@ form inside of a { } set builder.
{} is a hash-map, if you wanted a set #{}
(def wrap-var)
(defmacro datalog-term
"Builds a term"
[relation & formals]
(let [wrapped-formals (map wrap-var formals)]
`(struct rule ~relation (set ~...@wrapped-formals))))
Which I think is more what you want.
Regards,
Tim.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---