diff options
author | Maxime Devos <maximedevos@telenet.be> | 2023-03-04 02:25:14 +0100 |
---|---|---|
committer | Maxime Devos <maximedevos@telenet.be> | 2023-03-04 02:25:14 +0100 |
commit | c0951e2048da99976494205b1d0c8f65e44e71e3 (patch) | |
tree | 8579fd8f0dc162c2d71a957de4341d58beffb181 | |
parent | bcfd4f34d149215fc87959ca84b6069012eea56e (diff) | |
download | gnunet-scheme-c0951e2048da99976494205b1d0c8f65e44e71e3.tar.gz gnunet-scheme-c0951e2048da99976494205b1d0c8f65e44e71e3.zip |
dht/client: Use #:constructor-keyword-arguments instead of wrapping.
Finally, the promised commit. Equivalent behaviour, but less
boilerplate, as it is called.
* gnu/gnunet/dht/client.scm (<insertion>)[%make-insertion,%make-insertion/share]:
Remove constructor in favour of a direct make-insertion /
make-insertion/share by using #:constructor-keyword-arguments.
-rw-r--r-- | gnu/gnunet/dht/client.scm | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/gnu/gnunet/dht/client.scm b/gnu/gnunet/dht/client.scm index 3874c32..789dc97 100644 --- a/gnu/gnunet/dht/client.scm +++ b/gnu/gnunet/dht/client.scm | |||
@@ -271,8 +271,17 @@ the constructor." | |||
271 | #:copy (copy-insertion | 271 | #:copy (copy-insertion |
272 | "Make a copy of the insertion, such that modifications to the | 272 | "Make a copy of the insertion, such that modifications to the |
273 | slices in the old insertion do not impact the new insertion.") | 273 | slices in the old insertion do not impact the new insertion.") |
274 | #:constructor/copy %make-insertion | 274 | #:constructor/copy make-insertion |
275 | #:constructor %make-insertion/share | 275 | #:constructor (make-insertion/share |
276 | "Make an insertion object for inserting the datum @var{datum}, | ||
277 | desiring a replication level @var{desired-replication-level} (see ??). | ||
278 | |||
279 | Insertions are cisw (?) ojects and as such the procedures | ||
280 | @code{insertion->datum}, @code{insertion-desired-replication-level}, | ||
281 | @code{insertion?}, @code{make-insertion}, @code{make-insertion/share} | ||
282 | and @code{insertion=?} have the usual semantics.") | ||
283 | ;; TODO defaults | ||
284 | #:constructor-keyword-arguments (datum #:key (desired-replication-level 3)) | ||
276 | #:equality insertion=? | 285 | #:equality insertion=? |
277 | #:field (datum #:copy copy-datum | 286 | #:field (datum #:copy copy-datum |
278 | #:equality datum=? | 287 | #:equality datum=? |
@@ -284,18 +293,6 @@ slices in the old insertion do not impact the new insertion.") | |||
284 | #:getter insertion-desired-replication-level | 293 | #:getter insertion-desired-replication-level |
285 | #:preprocess bound-replication-level)) | 294 | #:preprocess bound-replication-level)) |
286 | 295 | ||
287 | (define* (make-insertion datum #:key (desired-replication-level 3)) ; TODO defaults | ||
288 | "Make an insertion object for inserting the datum @var{datum}, | ||
289 | desiring a replication level @var{desired-replication-level} (see ??). | ||
290 | |||
291 | Insertions are cisw (?) ojects and as such the procedures | ||
292 | @code{insertion->datum}, @code{insertion-desired-replication-level}, | ||
293 | @code{insertion?}, @code{make-insertion}, @code{make-insertion/share} | ||
294 | and @code{insertion=?} have the usual semantics." | ||
295 | (%make-insertion datum desired-replication-level)) | ||
296 | (define* (make-insertion/share datum #:key (desired-replication-level 3)) | ||
297 | (%make-insertion/share datum desired-replication-level)) | ||
298 | |||
299 | (define-record-type (<query> make-query query?) | 296 | (define-record-type (<query> make-query query?) |
300 | (fields (immutable type query-type) | 297 | (fields (immutable type query-type) |
301 | (immutable key query-key) | 298 | (immutable key query-key) |