1
1
# Active Clojure
2
2
3
+ ## Breaking changes in recent releases
4
+
3
5
A library with various basic utilities for programming with Clojure.
4
6
5
7
[ ![ Clojars Project] ( https://img.shields.io/clojars/v/de.active-group/active-clojure.svg )] ( https://clojars.org/de.active-group/active-clojure )
6
8
[ ![ Actions Status] ( https://github.com/active-group/active-clojure/workflows/ci/badge.svg )] ( https://github.com/active-group/active-clojure/actions )
7
9
[ ![ cljdoc badge] ( https://cljdoc.org/badge/de.active-group/active-clojure )] ( https://cljdoc.org/d/de.active-group/active-clojure/CURRENT )
8
10
9
- ### Breaking changes in version ` 0.40.0 `
11
+ ### ` 0.40.0 `
10
12
11
13
- ` active.clojure.monad/run-monadic-swiss-army ` was renamed to
12
14
` active.clojure.monad/run-monadic ` .
13
15
14
- ### Breaking changes in version ` 0.38 `
16
+ ### ` 0.38 `
15
17
16
18
- For an RTD record ` MyRecord ` , ` (MyRecord :meta) ` will no longer
17
19
return a meta data map. Use ` (meta #'MyRecord) ` instead.
18
20
19
- ### Breaking changes since version ` 0.28.0 `
21
+ ### Since ` 0.28.0 `
20
22
21
23
- Clojure version 1.9.0 or higher and Clojurescript version 1.9.542 or higher
22
24
are required.
@@ -35,9 +37,8 @@ A library with various basic utilities for programming with Clojure.
35
37
36
38
### Records
37
39
38
- The ` active.clojure.record ` namespace implements a
39
- ` define-record-type ` form similar to Scheme's [ SRFI
40
- 9] ( http://srfi.schemers.org/srfi-9/ ) .
40
+ The ` active.clojure.record ` namespace implements a ` define-record-type ` form
41
+ similar to Scheme's [ SRFI 9] ( http://srfi.schemers.org/srfi-9/ ) .
41
42
42
43
Example: A card consists of a number and a color
43
44
@@ -63,8 +64,6 @@ Example: A card consists of a number and a color
63
64
; ; => false
64
65
```
65
66
66
- ### Options
67
-
68
67
You can provide additional options in an option-map as second argument to ` define-record-type ` .
69
68
70
69
#### Specs
@@ -128,42 +127,39 @@ provided for the selector functions:
128
127
129
128
#### Non generative option
130
129
131
- If you provide a value (uid) to the ` nongenerative ` option,
132
- the record-creation operation is nongenerative i.e.,
133
- a new record type is created only if no previous call to
134
- ` define-record-type ` was made with the uid.
135
- Otherwise, an error is thrown.
136
- If uid is ` true ` , a uuid is created automatically.
137
- If this option is not given (or value is falsy),
138
- the record-creation operation is generative, i.e.,
139
- a new record type is created even if a previous call
140
- to ` define-record-type ` was made with the same arguments.
130
+ If you provide a value (uid) to the ` nongenerative ` option, the record-creation
131
+ operation is nongenerative i.e., a new record type is created only if no
132
+ previous call to ` define-record-type ` was made with the uid. Otherwise, an
133
+ error is thrown. If uid is ` true ` , a uuid is created automatically. If this
134
+ option is not given (or value is falsy), the record-creation operation is
135
+ generative, i.e., a new record type is created even if a previous call to
136
+ ` define-record-type ` was made with the same arguments.
141
137
142
138
#### Arrow constructor
143
139
144
140
Default is ` true ` .
145
141
146
- If you provide the key: val pair ` :arrow-constructor? ` :` false ` ,
147
- the creation of the arrow-constructor of the ` defrecord ` call is omitted,
148
- i.e.
142
+ If you provide the key: val pair ` :arrow-constructor? ` :` false ` , the creation of
143
+ the arrow constructor of the ` defrecord ` call is omitted, i.e.
149
144
150
145
``` clojure
151
146
(define-record-type Test {:arrow-constructor? false } (make-test a) ... )
152
147
```
153
- won't yield a function ` ->Test ` .
148
+
149
+ won't create a function ` ->Test ` .
154
150
155
151
#### Map protocol
156
152
157
153
Default is ` true ` .
158
154
159
- If you don't want your records to implement the Map- protocols (in * Clojure*
155
+ If you don't want your records to implement the Map protocols (in * Clojure*
160
156
these are ` java.util.Map ` and ` clojure.lang.IPersistentMap ` , in * ClojureScript*
161
157
` IMap ` and ` IAssociative ` ), you can provide the key: val pair
162
158
` :map-protocol? ` :` false ` to the options map.
163
159
164
160
#### Remove default interfaces/protocols
165
161
166
- There are a number of interfaces, that our records defaultly implement (like
162
+ There are a number of interfaces, that our records implement by default (like
167
163
e.g. aforementioned ` java.util.Map ` ). Providing key: val pair
168
164
` :remove-interfaces ` :` [interface1 interface2 ...] ` will prevent the
169
165
implementations of the given interfaces.
0 commit comments