Liking cljdoc? Tell your friends :D

clojure.core.typed.lang.jvm

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.
raw docstring

default-evalclj

(default-eval form)

Roughly equivalent to clojure.core/eval.

Roughly equivalent to clojure.core/eval.
sourceraw docstring

default-load1clj

(default-load1 base-resource-path)

Roughly equivalent to clojure.core/load.

Roughly equivalent to clojure.core/load.
sourceraw docstring

extensible-evalclj

(extensible-eval form)

Evaluates the form data structure (not text!) and returns the result.

Evaluates the form data structure (not text!) and returns the result.
sourceraw docstring

extensible-loadclj

(extensible-load & paths)

Loads Clojure code from resources in classpath. A path is interpreted as classpath-relative if it begins with a slash or relative to the root directory for the current namespace otherwise.

Loads Clojure code from resources in classpath. A path is interpreted as
classpath-relative if it begins with a slash or relative to the root
directory for the current namespace otherwise.
sourceraw docstring

file-langclj

(file-lang res)

Returns the :lang entry in ns form in the given namespace.

Returns the :lang entry in ns form in the given namespace.
sourceraw docstring

installclj

(install)
(install features)

A no-argument function that installs extensible eval and load alternatives that respect :lang ns metadata

A no-argument function that installs extensible `eval` and `load`
alternatives that respect :lang ns metadata
sourceraw docstring

lang-dispatchclj

A map from :lang entries to their corresponding load and eval alternatives.

A map from :lang entries to their corresponding `load` and `eval` alternatives.
sourceraw docstring

monkey-patch-extensible-evalclj

A no-argument function that installs the extensible eval function over clojure.core/eval.

A no-argument function that installs the extensible `eval` function
over clojure.core/eval.
sourceraw docstring

monkey-patch-extensible-loadclj

A no-argument function that installs the extensible load function over clojure.core/load.

A no-argument function that installs the extensible `load` function
over clojure.core/load.
sourceraw docstring

ns-langclj

(ns-lang ns)

Returns the :lang value in the give Namespace's metadata.

Returns the :lang value in the give Namespace's metadata.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close