-
Notifications
You must be signed in to change notification settings - Fork 85
Conversation
src/cljs/snapshot/lumo/repl.cljs
Outdated
;; emit function values into JavaScript as numeric | ||
;; references that are looked up. | ||
|
||
(defonce ^:private fn-index (atom 0)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these don't need to be atoms. can you switch them to volatiles?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great ideas are always worth stealing. planck-repl/planck@0f29414
src/cljs/snapshot/lumo/repl.cljs
Outdated
(defn- clear-fns! | ||
"Clears saved functions." | ||
[] | ||
(reset! fn-refs {})) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
vreset!
once they're volaties
src/cljs/snapshot/lumo/repl.cljs
Outdated
(defn- put-fn | ||
"Saves a function, returning a numeric representation." | ||
[f] | ||
(let [n (swap! fn-index inc)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
vswap!
This looks great! Left a few inline comments and I'll merge once you address them. Thanks! |
Sorry about the messy history! The windows specific commit should go in another branch. |
thanks! |
See #146
Question: should the new
lumo.repl/eval
be exposed anywhere else?