More docs on the let macros.
This commit is contained in:
parent
08f5ff5d0d
commit
6aab1b6bd1
|
@ -214,6 +214,10 @@ based on the results of the bindings. This is useful for reducing
|
||||||
common boilerplate where a let is used to perform some operations, and
|
common boilerplate where a let is used to perform some operations, and
|
||||||
some code should be executed based on the results of those bindings.
|
some code should be executed based on the results of those bindings.
|
||||||
|
|
||||||
|
For example, from @c(kmop/kmop.lisp):
|
||||||
|
|
||||||
|
@code(@include[path="whenlet.lisp"]())
|
||||||
|
|
||||||
@cl:with-package[name="kutils"](
|
@cl:with-package[name="kutils"](
|
||||||
@cl:doc(macro condlet)
|
@cl:doc(macro condlet)
|
||||||
@cl:doc(macro condlet*)
|
@cl:doc(macro condlet*)
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
* (macroexpand-1
|
||||||
|
'(whenlet ((kwarg (slot-initarg slot))
|
||||||
|
(value (dispatch-get-value
|
||||||
|
slot
|
||||||
|
(slot-table-value
|
||||||
|
slot ht snake-case))))
|
||||||
|
(list kwarg value)))
|
||||||
|
(LET ((KWARG (SLOT-INITARG SLOT))
|
||||||
|
(VALUE
|
||||||
|
(DISPATCH-GET-VALUE SLOT
|
||||||
|
(SLOT-TABLE-VALUE SLOT HT SNAKE-CASE))))
|
||||||
|
(WHEN (AND KWARG VALUE)
|
||||||
|
(LIST KWARG VALUE)))
|
Loading…
Reference in New Issue