Fork me on GitHub
#clojure-dev
<
2020-05-10
>
vlaaad05:05:41

You can achieve same performance with multiple arities of vswap! function

vlaaad05:05:39

(vswap! (volatile! (prn 1)) identity)

vlaaad05:05:57

Prints "1" twice

serioga09:05:54

@vlaaad As I see vswap! is implemented as macro just to assign the type hint to volatile and avoid reflection on .reset and .deref invocations

vlaaad09:05:09

You can doo all that without making vswap! a macro

serioga10:05:04

> Prints "1" twice looks like it is not designed to work with volatiles which you cannot access directly 🙂

vlaaad10:05:22

the discussion in the comments seems to be derailed because of :inline in the patch...