Repository for my post: A JavaScript / Clojure mashup
JavaScript Clojure
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
README.md
UNLICENSE
clojure.clj
javascript.js

README.md

Repository for my post: A JavaScript / Clojure mashup.

The following Clojure and JavaScript examples are equivalent. Both data structures are executed in a similar fashion and with an identical result. Please read the post for more information.

(if (> 10 20)
  "Uh, well this is awkward."
  (str "EVERYTHING IS FINE, MOVE ALONG " (reduce + [2 2 3])))
[$if, [$mt, 10, 20],
    'Uh, well this is awkward.',
    [str, 'EVERYTHING IS FINE, MOVE ALONG ', [reduce, $add, quote([1, 2, 3])]]];

Obviously the missing functions ($mt, str, reduce and $add. $mt means "more than") and the $if macro (yes, it's a macro. It manipulates the tree) are defined in the JavaScript file.

This isn't exactly a library, just an experiment. I may well take it further one day though because I found it really interesting.

License

This repository is licensed under the unlicense, so you can basically do what you want. Find the full thing in the UNLICENSE file.

This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.