You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
These macros apply an operation to the current value of a variable and
then set the variable to the result of the application. They are
effectively sugar for writing `(set! <var> (<op> <var> <val>))` and
should be familiar to those who have programmed in imperative languages
like C.
In Carp, all the underlying operations these macros use are interfaces,
so one can flexibly use them for more than just numeric types.
Example usage:
```clojure
(let-do [dial 0]
;; crank it up to 11!
(while-do (dial < 12)
(++ dial))
dial)
;; expanded
(let-do [dial 0]
;; crank it up to 11!
(while-do (dial < 12)
(set! dial (inc dial)))
dial)
```
0 commit comments