aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Okay <okay@toyful.space>2020-12-13 11:58:05 -0600
committerColin Okay <okay@toyful.space>2020-12-13 11:58:05 -0600
commit8978d58be4d6798c56cb00016fd1e65460e10434 (patch)
tree442e88a466280b3842216deebd725f37a171e8f6
parentfd6f850d1ac3f498a5b952b0cd3304f2e2f24ecf (diff)
binding>
-rw-r--r--macros.lisp10
1 files changed, 5 insertions, 5 deletions
diff --git a/macros.lisp b/macros.lisp
index 9ecf7ef..6630946 100644
--- a/macros.lisp
+++ b/macros.lisp
@@ -174,17 +174,17 @@ printed. But the next time only the return value is used.
-(defmacro monadic ((&key (exit-when #'null) (exit-with #'identity)) init &rest functions)
+(defmacro binding> ((&key (exit-when #'null) (exit-with #'identity)) init &rest functions)
"A threading macro. Some examples:
-(monadic ()
+(binding> ()
\"hey dude what's the big idea\" ; starting state
#$(values (search \"the\" $s) $s) ; multiple-values are passed along as arguments
#$(subseq $2 $1)) : returns the result of the last form
should return \"the big idea\"
-(monadic (:exit-with \"☹\")
+(binding> (:exit-with \"☹\")
\"hey dude what's the big idea?\"
#$(values (search \"NOOOOOOPE\" $s) $s)
#$(subseq $2 $1))
@@ -192,13 +192,13 @@ should return \"the big idea\"
should return \"☹\".
EXIT-WHEN should be a function, a predicate, that operates on the
-first value returned from one of the forms. If non-NIL, the MONADIC
+first value returned from one of the forms. If non-NIL, the BINDING>
form returns by calling the EXIT-WITH function on the list of values
returned the the most recently called function.
e.g
-(monadic (:exit-when #'evenp
+(binding> (:exit-when #'evenp
:exit-with #$(list* :failed $x))
33
#$(+ 11 $x)