~pepe/eleanor

1b19a27a1c552d883918a976b359a8483f18b091 — Josef Pospíšil a month ago d35c7e5
Tune path digestion
1 files changed, 9 insertions(+), 8 deletions(-)

M eleanor/init.janet
M eleanor/init.janet => eleanor/init.janet +9 -8
@@ 32,16 32,17 @@
    (loop [p :in path]
      (match
        (protect
          (match p
            (f (function? f) (= (disasm f :arity) 1))
            (f base)
            (f (function? f) (= (disasm f :arity) 2))
            (f base collected)
            d (get base d)))
          (if (function? p)
            (case (disasm p :arity)
              1 (p base)
              2 (p base collected)
              (base p))
            (base p)))
        [true new-base] (set base new-base)
        [false err] (error (string "Point " (describe p) " errored with: " err))))
    (if (empty? collected)
      base (array/insert collected 0 base))))
    (if-not (empty? collected)
      (array/insert collected 0 base)
      base)))

(def => "guide alias" guide)