Skip to content

Commit

Permalink
[#415] lift return conditional - @joinr
Browse files Browse the repository at this point in the history
borkdude committed Sep 19, 2020

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent ce1a17e commit a939d1e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/sci/impl/fns.cljc
Original file line number Diff line number Diff line change
@@ -20,6 +20,10 @@
fn-name macro? with-meta?]
(let [min-var-args-arity (when var-arg-name fixed-arity)
body-count (count body)
return (if (= 1 body-count)
(let [fst (first body)]
#(interpret % fst))
#(eval-do* % body))
f (fn run-fn [& args]
(let [;; tried making bindings a transient, but saw no perf improvement (see #246)
bindings (.get ^java.util.Map ctx :bindings)
@@ -41,9 +45,7 @@
(throw-arity fn-name macro? args))
ret)))
ctx (assoc ctx :bindings bindings)
ret (if (= 1 body-count)
(interpret ctx (first body))
(eval-do* ctx body))
ret (return ctx)
;; m (meta ret)
recur? (instance? Recur ret)]
(if recur?

0 comments on commit a939d1e

Please sign in to comment.