wisp-lang / wisp

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

Show LISP tree after macro expansion #104

Closed sander closed 10 years ago

sander commented 10 years ago

It would be nice to have a command like wisp --show-macro-expansion that shows me the LISP code after the macros are expanded, and before it is compiled to JS. Or does such a flag already exist?

Gozala commented 10 years ago

Such feature has being added and you can use it if you run wisp from master, once next version is released on npm it will be available from npm installation as well.

Following should should do what you expect:

echo "(print :hi)" | ./bin/wisp.js --print expansion
sander commented 10 years ago

Nice, thanks! I’m on commit a144d1bbf94c7b9d4ca390924f52857c31918831 (2014-05-23) from master. I’ve run npm install and tried your command, but I get:

sanderbook:wisp sander$ echo "(print :hi)" | ./bin/wisp.js --print expansion
nilsanderbook:wisp sander$

Also other options for --print seem to result in nil. When running wisp.js --print without a value, I do get error: option--print ' argument missing` as expected.

Is this a different issue or am I just doing it wrong? :-)