Fork me on GitHub
#clojure-dev
<
2020-05-09
>
vlaaad20:05:48

what is the rationale behind making vswap! a macro instead of a function like vreset! or swap! ?

vlaaad20:05:30

it seems that macro can be written as a function, and all it does is... double-evaluates the volatile arg expr

favila21:05:38

Probably performance? Volatiles are designed to be as fast as possible short of an actual local). Even a let binding to guarantee single-eval would compromise that

ghadi21:05:29

there is no "double eval" here