wisp-lang / wisp

A little Clojure-like LISP in JavaScript
https://gozala.github.io/wisp/
Other
980 stars 68 forks source link

Macros expanding to primitives thow exceptions #121

Open butaji opened 9 years ago

butaji commented 9 years ago

This code is working well in ClojureScript

(defmacro render [x] (name (first x)))
(render [:html])

=> "html" but stuck in wisp. Interesting thing, that if I add brackets [] outside result like this

(defmacro render [x] [(name (first x))])
(render [:html])

=> ['html']

it works well. How can I resolve this issue?

robjens commented 9 years ago

Shouldn't the correct form just be:

(defmacro render [x] (list 'name (first x)))
(render [:html])
;=> html