1
0
mirror of https://github.com/janet-lang/janet synced 2025-10-25 12:47:42 +00:00

Fix if-let when-let and add put-in (assoc-in)

This commit is contained in:
Gavlooth
2018-03-25 11:30:30 +03:00
parent 1bc5705667
commit 5ff0367d0f
2 changed files with 23 additions and 3 deletions

View File

@@ -371,7 +371,6 @@ If no match is found, returns nil"
all the forms with let and evaluates the first expression else
evaluates the second"
[bindings then else]
#(tuple 'print (tuple '> (tuple 'length bindings) 2))
(tuple 'let bindings
(tuple 'if (tuple 'and (tuple 'get bindings 1)
(tuple 'if
@@ -384,8 +383,7 @@ If no match is found, returns nil"
"Takes the first one or two forms in vector and if true binds
all the forms with let and evaluates the body"
[bindings & body]
(def head (ast-unwrap1 bindings))
(tuple 'let head
(tuple 'let bindings
(tuple
'when
(tuple 'and (tuple 'get bindings 1)