summaryrefslogtreecommitdiff
path: root/.fenneldoc
blob: 3cdf8b6f5ae0e8dc2c984af4c15f72be390b8785 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
;; -*- mode: fennel; -*- vi:ft=fennel
;; Configuration file for Fenneldoc v0.1.9
;; https://gitlab.com/andreyorst/fenneldoc

{:fennel-path {}
 :function-signatures true
 :ignored-args-patterns ["[a-z]"
                         "%.%.%."
                         "[xkf]s"
                         "kvs"
                         "col[0-9]"
                         "cols?"
                         "rest"
                         "more"
                         "keys"
                         "tbl"
                         "_"
                         "cs"
                         "sep"
                         "coll"
                         "Set"
                         "s[0-9]+"
                         "ss"
                         "args"]
 :inline-references "link"
 :insert-comment true
 :insert-copyright true
 :insert-license true
 :insert-version true
 :keys {:copyright "_COPYRIGHT"
        :description "_DESCRIPTION"
        :doc-order "_DOC_ORDER"
        :license "_LICENSE"
        :module-name "_MODULE_NAME"
        :version "_VERSION"}
 :mode "checkdoc"
 :modules-info {:init-macros.fnl {:description "Macros for fennel-cljlib."
                                  :name "macros"}
                :init.fnl {:description "Fennel-cljlib - functions from Clojure's core.clj implemented on top
of Fennel.

This library contains a set of functions providing functions that
behave similarly to Clojure's equivalents.  Library itself has nothing
Fennel specific so it should work on Lua, e.g:

``` lua
Lua 5.3.5  Copyright (C) 1994-2018 Lua.org, PUC-Rio
> clj = require\"cljlib\"
> table.concat(clj.mapv(function (x) return x * x end, {1, 2, 3}), \" \")
-- 1 4 9
```

This example is mapping an anonymous `function' over a table,
producing new table and concatenating it with `\" \"`.

However this library also provides Fennel-specific set of
[macros](./macros.md), that provides additional facilities like
`defn' or `defmulti' which extend the language allowing writing code
that looks and works mostly like Clojure.

Each function in this library is created with `defn', which is a
special macros for creating multi-arity functions.  So when you see
function signature like `(foo [x])`, this means that this is function
`foo', that accepts exactly one argument `x'.  In contrary, functions
created with `fn' will produce `(foo x)` signature (`x' is not inside
brackets).

Functions, which signatures look like `(foo ([x]) ([x y]) ([x y &
zs]))`, it is a multi-arity function, which accepts either one, two,
or three-or-more arguments.  Each `([...])` represents different body
of a function which is chosen by checking amount of arguments passed
to the function.  See [Clojure's doc section on multi-arity
functions](https://clojure.org/guides/learn/functions#_multi_arity_functions).

## Compatibility
This library is mainly developed with Lua 5.4, and tested against
Lua 5.2, 5.3, 5.4, and LuaJIT 2.1.0-beta3.  Note, that in lua 5.2 and
LuaJIT equality semantics are a bit different from Lua 5.3 and Lua 5.4.
Main difference is that when comparing two tables, they must have
exactly the same `__eq` metamethods, so comparing hash sets with hash
sets will work, but comparing sets with other tables works only in
Lua5.3+.  Another difference is that Lua 5.2 and LuaJIT don't have
inbuilt UTF-8 library, therefore `seq' function will not work for
non-ASCII strings."
                           :doc-order ["apply"
                                       "add"
                                       "sub"
                                       "mul"
                                       "div"
                                       "le"
                                       "lt"
                                       "ge"
                                       "gt"
                                       "inc"
                                       "dec"
                                       "eq"
                                       "map?"
                                       "vector?"
                                       "multifn?"
                                       "set?"
                                       "nil?"
                                       "zero?"
                                       "pos?"
                                       "neg?"
                                       "even?"
                                       "odd?"
                                       "string?"
                                       "boolean?"
                                       "true?"
                                       "false?"
                                       "int?"
                                       "pos-int?"
                                       "neg-int?"
                                       "double?"
                                       "empty?"
                                       "not-empty"
                                       "vector"
                                       "seq"
                                       "first"
                                       "rest"
                                       "last"
                                       "butlast"
                                       "conj"
                                       "disj"
                                       "cons"
                                       "concat"
                                       "reduce"
                                       "reduced"
                                       "reduce-kv"
                                       "mapv"
                                       "filter"
                                       "every?"
                                       "some"
                                       "not-any?"
                                       "range"
                                       "reverse"
                                       "take"
                                       "nthrest"
                                       "partition"
                                       "identity"
                                       "comp"
                                       "complement"
                                       "constantly"
                                       "memoize"
                                       "assoc"
                                       "hash-map"
                                       "get"
                                       "get-in"
                                       "keys"
                                       "vals"
                                       "find"
                                       "dissoc"
                                       "remove-method"
                                       "remove-all-methods"
                                       "methods"
                                       "get-method"
                                       "hash-set"]
                           :name "core"}}
 :order "alphabetic"
 :out-dir "./doc"
 :project-copyright "Copyright (C) 2020-2021 Andrey Listopadov"
 :project-doc-order {}
 :project-license "[MIT](https://gitlab.com/andreyorst/fennel-cljlib/-/raw/master/LICENSE)"
 :project-version "v1.0.0"
 :sandbox false
 :test-requirements {:init-macros.fnl "(require-macros :init-macros)
                                       (import-macros {: assert-eq} :fennel-test)
                                       (local {: eq : vector : hash-map} (require :init))"
                     :init.fnl "(require-macros :init-macros)
                                (require-macros :fennel-test)"
                     :tests/test.fnl "(require-macros :fennel-test)"}
 :toc true}