Extensible languages in Clojure, a la Racket's #lang.
This is a simple library that monkey patches clojure.core/load to be extensible to different backends.
monkey-patch-extensible-load does the actual monkey-patching and
must be called explicitly.
lang-dispatch is a map from keywords to alternative load functions
(of type [String -> nil]). The corresponding function will be used to
load a file according its :lang metadata entry in the ns form.
To add a new implementation, use (alter-var-root lang-dispatch assoc :new-impl my-load)
eg. A file with a ns form
(ns fancy-ns-form
{:lang :new-impl})
will use my-load to load the file.
Extensible languages in Clojure, a la Racket's #lang.
This is a simple library that monkey patches clojure.core/load
to be extensible to different backends.
`monkey-patch-extensible-load` does the actual monkey-patching and
must be called explicitly.
`lang-dispatch` is a map from keywords to alternative `load` functions
(of type [String -> nil]). The corresponding function will be used to
load a file according its :lang metadata entry in the `ns` form.
To add a new implementation, use
(alter-var-root lang-dispatch assoc :new-impl my-load)
eg. A file with a `ns` form
(ns fancy-ns-form
{:lang :new-impl})
will use `my-load` to load the file.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |