Add named arguments with the &named symbol.

Similar to &keys, but more ergonomic.
This commit is contained in:
Calvin Rose
2022-06-12 13:53:18 -05:00
parent 6d188f6e44
commit 87fc339c45
4 changed files with 93 additions and 36 deletions
+7
View File
@@ -80,5 +80,12 @@
"table rawget regression"
(table/new -1))
# Named arguments
(defn named-arguments
[&named bob sally joe]
(+ bob sally joe))
(assert (= 15 (named-arguments :bob 3 :sally 5 :joe 7)) "named arguments 1")
(end-suite)