We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 19da711 + c74aa83 commit ff43160Copy full SHA for ff43160
library/src-bootstrapped/scala/quoted/util/Var.scala
@@ -17,21 +17,21 @@ object Var {
17
/** Create a variable initialized with `init` and used in `body`.
18
* `body` recieves a `Var[T]` argument which exposes `get` and `update`.
19
*
20
- * `var`('(7)) {
+ * Var('{7}) {
21
* x => '{
22
- * while(0 < ~x)
23
- * ~x.update('(~x - 1))
24
- * ~x.get
+ * while(0 < ${x.get})
+ * ${x.update('{${x.get} - 1})}
+ * ${x.get}
25
* }
26
27
28
- * will create the equivalent of
+ * will create the equivalent of:
29
30
* '{
31
* var x = 7
32
* while (0 < x)
33
* x = x - 1
34
- * x
+ * x
35
36
*/
37
def apply[T: Type, U: Type](init: Expr[T])(body: Var[T] => Expr[U]) given QuoteContext: Expr[U] = '{
0 commit comments