1
0
mirror of https://github.com/janet-lang/janet synced 2024-11-28 19:19:53 +00:00

Fix documentation for if-with.

It was the same as when-with.
This commit is contained in:
Calvin Rose 2020-01-16 18:12:05 -06:00
parent 174ff87946
commit 6d9e51e4be

View File

@ -313,8 +313,9 @@
,;body))) ,;body)))
(defmacro if-with (defmacro if-with
"Similar to with, but if binding is false or nil, returns "Similar to with, but if binding is false or nil, evaluates
nil without evaluating the body. Otherwise, the same as with." the falsey path. Otherwise, evaluates the truthy path. In both cases,
ctor is bound to binding."
[[binding ctor dtor] truthy &opt falsey ] [[binding ctor dtor] truthy &opt falsey ]
~(if-let [,binding ,ctor] ~(if-let [,binding ,ctor]
(defer (,(or dtor :close) ,binding) ,truthy) (defer (,(or dtor :close) ,binding) ,truthy)