wisp-lang / wisp

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

Avoid macros transpilation into "void 0" #85

Open h2non opened 10 years ago

h2non commented 10 years ago

Macros definition transpiles into "void 0". There is a CLI flag to remote it in the escodegen generator or is planned to remove it definitively in another way??

Thanks in advanced!

Gozala commented 10 years ago

Only reason macros generate void 0 expressions is because macros definitions do not compile to anything so easiest solution was to just produce void 0. Once #3 is fixed this is likely to be fixed too.

Likely it can be also fixed by slightly changing analyze-forms function to skip nodes that produce nil as result. The only issue is that single nil would also produce no output so that's why it kind end up where it is now.