1
0
mirror of https://github.com/janet-lang/janet synced 2024-12-26 08:20:27 +00:00

Tweak get-in behavior

This commit is contained in:
sogaiu 2021-08-06 08:24:26 +09:00
parent 61769c8f16
commit 2080ac3bda

View File

@ -1351,7 +1351,7 @@
a sequence of keys.`
[ds ks &opt dflt]
(var d ds)
(loop [k :in ks :while d] (set d (get d k)))
(loop [k :in ks :while (not (nil? d))] (set d (get d k)))
(if (= nil d) dflt d))
(defn update-in