diff options
| author | Andrey Listopadov <andreyorst@gmail.com> | 2022-10-29 15:49:30 +0300 |
|---|---|---|
| committer | Andrey Listopadov <andreyorst@gmail.com> | 2022-10-29 15:49:30 +0300 |
| commit | 85db8b8549d9d45e39c1a5118d91d3fd3a88818f (patch) | |
| tree | e361634f34392b8a337e44f21aea290c4dcd19d5 /README.md | |
| parent | 611e364488cf6f91b9faf65b13f90f428788d51b (diff) | |
remove the :relative require, update installation guide, update docstrings
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 26 |
1 files changed, 16 insertions, 10 deletions
@@ -1,29 +1,35 @@ # Fennel Cljlib -Experimental library for [Fennel](https://fennel-lang.org/) language, that adds many functions from [Clojure](https://clojure.org/)'s standard library. -This is not a one to one port of Clojure `core`, because many Clojure functions require certain guarantees, like immutability and laziness, which are hard to efficiently implement on top of Lua. +Experimental library for the [Fennel](https://fennel-lang.org/) language, that adds many functions from [Clojure](https://clojure.org/)'s standard library. +This is not a one-to-one port of Clojure `core`, because many Clojure features require certain facilities from the runtime. +This library implements lazy sequences, transducers, immutable tables, sets and vectors, transients, and a lot of functions from the `core` namespace. Some semantics like concurrency, or dynamic scope is not supported by Lua runtime at all. -Therefore certain functions were altered to better suit the domain. +Therefore, certain functions were altered to better suit the domain. ## Installation Clone library into your project or put it as a git submodule: - $ git clone --recursive https://gitlab.com/andreyorst/fennel-cljlib cljlib + $ git clone --recursive https://gitlab.com/andreyorst/fennel-cljlib club Now you can require `:cljlib` from Fennel: -``` clojure +``` fennel (local clj (require :cljlib)) (import-macros cljm :cljlib) ``` -Optionally precompile the library to make it load slightly faster: +Make sure to set up the `FENNEL_PATH` and `LUA_PATH` to include the installation directory: - $ cd cljlib; COMPILEFLAGS="--require-as-include" make + FENNEL_PATH="cljlib/?/init.fnl;$FENNEL_PATH" + LUA_PATH="cljlib/?/init.lua;#LUA_PATH" -This will compile `init.fnl` into `init.lua`, with all dependencies included, so `require` should honor Lua files over Fennel files. -It is also possible to use this library from Lua this way. +Alternatively, precompile the library to make it load slightly faster: + + $ cd cljlib; make + +This will compile `init.fnl` into the `cljlib.lua` file, with all dependencies included. +It is also possible to use this library directly from Lua this way. ## Documentation @@ -34,5 +40,5 @@ Documentation is auto-generated with [Fenneldoc](https://gitlab.com/andreyorst/f Please make sure you've read [contribution guidelines](https://gitlab.com/andreyorst/fennel-cljlib/-/tree/master/CONTRIBUTING.md). <!-- LocalWords: Lua submodule precompile cljlib docstring config - LocalWords: namespace destructure + LocalWords: namespace destructure runtime Clojure --> |