docs: fix typo in make-deriver and add implementor note (#1155)

This commit is contained in:
Veit Heller 2021-01-27 19:00:31 +01:00 committed by GitHub
parent 8e1e827e57
commit 881e904ae9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,3 +1,8 @@
; Implementors note: this code could be made more elegant by using quasiquotes
; but quasiquoting is actually loaded after this module, so we cant rely on
; that functionality.
(doc Derive "is a mechanism for deriving interfaces automatically.
Please reference [the documentation](https://github.com/carp-lang/Carp/blob/master/docs/Derive.md)
@ -15,7 +20,7 @@ Example:
(make-deriver 'zero []
(fn [t]
(cons 'init
(map (fn [_] '(zero)) (members t)))))
(map (fn [_] '(zero)) (eval `(members %t)))))
```")
(defndynamic make-deriver [f args body]
(set! Derive.derivers