1
0
mirror of https://github.com/janet-lang/janet synced 2025-10-31 15:43:01 +00:00

update if-let

Fixes #1189
This commit is contained in:
primo-ppcg
2023-06-11 16:38:04 +07:00
parent 7272f43191
commit 1077efd03a
2 changed files with 7 additions and 1 deletions

View File

@@ -674,7 +674,11 @@
(do
(def bl (in bindings i))
(def br (in bindings (+ 1 i)))
(tuple 'if (tuple 'def bl br) (aux (+ 2 i)) fal))))
(if (symbol? bl)
(tuple 'if (tuple 'def bl br) (aux (+ 2 i)) fal)
(tuple 'if (tuple 'def (def sym (gensym)) br)
(tuple 'do (tuple 'def bl sym) (aux (+ 2 i)))
fal)))))
(aux 0))
(defmacro when-let