Skip to content

Commit 78b0bab

Browse files
committed
Fix comment for Var
1 parent 19da711 commit 78b0bab

File tree

1 file changed

+7
-7
lines changed
  • library/src-bootstrapped/scala/quoted/util

1 file changed

+7
-7
lines changed

library/src-bootstrapped/scala/quoted/util/Var.scala

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,21 @@ object Var {
1717
/** Create a variable initialized with `init` and used in `body`.
1818
* `body` recieves a `Var[T]` argument which exposes `get` and `update`.
1919
*
20-
* `var`('(7)) {
20+
* Var('(7)) {
2121
* x => '{
22-
* while(0 < ~x)
23-
* ~x.update('(~x - 1))
24-
* ~x.get
22+
* while(0 < $x.get)
23+
* $x.update('($x.get - 1))
24+
* $x.get
2525
* }
2626
* }
2727
*
28-
* will create the equivalent of
28+
* will create the equivalent of:
2929
*
30-
* '{
30+
* {
3131
* var x = 7
3232
* while (0 < x)
3333
* x = x - 1
34-
* x
34+
* x
3535
* }
3636
*/
3737
def apply[T: Type, U: Type](init: Expr[T])(body: Var[T] => Expr[U]) given QuoteContext: Expr[U] = '{

0 commit comments

Comments
 (0)