Skip to content

Commit

Permalink
Allow interop forms on alet.
Browse files Browse the repository at this point in the history
Fixes #48
  • Loading branch information
niwinz committed Aug 1, 2017
1 parent 0b0a87e commit d673894
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/promesa/core.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,9 @@
(let [await# `await]
(->> (reverse (partition 2 bindings))
(reduce (fn [acc [l r]]
(if (and (coll? r) (symbol? (first r)))
(if (and (coll? r)
(symbol? (first r))
(not= "." (subs (name (first r)) 0 1)))
`(if (= ~await# ~(first r))
(bind ~(second r) (fn [~l] ~acc))
(let [~l ~r] ~acc))
Expand Down
3 changes: 2 additions & 1 deletion test/promesa/core_tests.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,8 @@
(let [result (p/alet [a (p/await (future-ok 50 1))
b 2
c 3
d (p/await (future-ok 100 4))]
d (p/await (future-ok 100 4))
e (.toString c)]
(+ a b c d))]
(p/then result (fn [result]
(t/is (= result 10))
Expand Down

0 comments on commit d673894

Please sign in to comment.