wisp-lang / wisp

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

Adding UMD-friendly browserExport.wisp file #147

Closed zot closed 6 years ago

zot commented 8 years ago

This commit adds a new engine file called browserExport.wisp that provides a UMD-friendly export for Wisp so that requirejs, etc. projects can easily access Wisp and all of its packages. It also adds build-support for that file in the Makefile.

zot commented 8 years ago

Maybe browserExport.wisp should be renamed to just export.wisp? There's nothing browsery about it.

chr15m commented 7 years ago

@zot I hacked this in:

https://github.com/Gozala/wisp/commit/839d739cbcb3040d4fb1ccdcd97653c7eed18cca

Your commits here seem to add a couple more things. Can we get an isolated PR that just fixes the UMD export? Does it also support commonjs and require? Sorry for my ignorance!

zot commented 7 years ago

Here's my new pull request. It makes the following changes:

src/expander.wisp: added doc strings to functions src/backend/escodegen/writer.wisp: make <- expand to "from" src/engine/browserExport.wisp: new file that exports everything as a module

I probably need to add the corresponding "<-" -> "from" change in the javascript writer as well but I haven't yet.

chr15m commented 6 years ago

@zot I've merged browserExport.wisp into master. Hopefully I got it right.