Derive
is a mechanism for deriving interfaces automatically.
Please reference the documentation for more information.
derivable?
Dynamic
(derivable? f)
checks whether a quoted interface name f
is currently
derivable.
derive
Macro
(derive t f :rest override)
derives an interface function f
for a type t
.
Optionally, it also takes an argument overrride
that overrides the name of
the generated function to avoid collisions.
make-deriver
Dynamic
(make-deriver f args body)
is a mechanism for providing your own deriver by providing
the interface name f
, the arguments it takes args
, and a function that can
generate a body when given a type body
.
Example:
(make-deriver 'zero []
(fn [t]
(cons 'init
(map (fn [_] '(zero)) (eval `(members %t)))))
make-update-deriver
Dynamic
(make-update-deriver interface)
is a convenience function for creating a deriver
for functions that you could pass into update-<member>
style functions.