manuel / wat-js

Concurrency and Metaprogramming for JS
MIT License
259 stars 8 forks source link

Question #1

Closed ghost closed 12 years ago

ghost commented 12 years ago

I'd love to be able to write CouchDB map and reduce functions in wat, can wat take a defined function and spit out an equivalent javascript function? Or am I thinking about this wrong?

It'd be great if you could provide an example on how to do this, if possible.

manuel commented 12 years ago

Hi Hank, thanks for your question. Wat is currently still very much in flux, but close to being usable.

You would load the .js files similar to how browser/browser.js or pc/repl.js do it, and then evaluate Lisp code using wat.eval. (Wat is currently interpreter-only.)

In the following weeks I'll put up more examples about how to make Wat run in other environments such as Node and CouchDB.