Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sequential rewriting broken in cljs #56

Open
ggeoffrey opened this issue Jul 22, 2022 · 1 comment
Open

Sequential rewriting broken in cljs #56

ggeoffrey opened this issue Jul 22, 2022 · 1 comment

Comments

@ggeoffrey
Copy link
Member

ggeoffrey commented Jul 22, 2022

Cljs macroexpansion needs to sequence test steps using a continuation passing style (we cannot block on a js runtime)
Current rewriting does not sequence steps correctly, the problem is exhibited by rcf/with.

@ggeoffrey ggeoffrey changed the title Sequential re Sequential rewriting broken in cljs Jul 22, 2022
@dustingetz
Copy link
Member

Workaround:

(defmacro with
  "Resource cleanup helper, based on missionary's dependency-free Task protocol, see https://github.com/leonoel/task"
  [dispose-fn & body]
  `(let [dispose# ~dispose-fn
         #_#_res# (do ~@body)]    ; busted, introduces second rewrite pass - see https://github.com/hyperfiddle/rcf/issues/56
     ~@body
     (dispose#) ; workaround - due to async dependency on body, must be in same RCF rewrite pass
     #_res#))

ggeoffrey added a commit that referenced this issue Jul 25, 2022
dustingetz pushed a commit that referenced this issue Aug 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants