From 78b0babccdb364013cfc6e3d40b372feadb32910 Mon Sep 17 00:00:00 2001 From: Aggelos Biboudis Date: Fri, 16 Aug 2019 10:02:35 +0200 Subject: [PATCH 1/2] Fix comment for Var --- .../src-bootstrapped/scala/quoted/util/Var.scala | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/library/src-bootstrapped/scala/quoted/util/Var.scala b/library/src-bootstrapped/scala/quoted/util/Var.scala index f1cff74bf5f4..b08719f2e4c9 100644 --- a/library/src-bootstrapped/scala/quoted/util/Var.scala +++ b/library/src-bootstrapped/scala/quoted/util/Var.scala @@ -17,21 +17,21 @@ object Var { /** Create a variable initialized with `init` and used in `body`. * `body` recieves a `Var[T]` argument which exposes `get` and `update`. * - * `var`('(7)) { + * Var('(7)) { * x => '{ - * while(0 < ~x) - * ~x.update('(~x - 1)) - * ~x.get + * while(0 < $x.get) + * $x.update('($x.get - 1)) + * $x.get * } * } * - * will create the equivalent of + * will create the equivalent of: * - * '{ + * { * var x = 7 * while (0 < x) * x = x - 1 - * x + * x * } */ def apply[T: Type, U: Type](init: Expr[T])(body: Var[T] => Expr[U]) given QuoteContext: Expr[U] = '{ From c74aa83da75d4c7e235d0fa537502bcf528af291 Mon Sep 17 00:00:00 2001 From: Aggelos Biboudis Date: Fri, 16 Aug 2019 10:11:37 +0200 Subject: [PATCH 2/2] Apply suggestions from code review Co-Authored-By: Nicolas Stucki --- library/src-bootstrapped/scala/quoted/util/Var.scala | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/library/src-bootstrapped/scala/quoted/util/Var.scala b/library/src-bootstrapped/scala/quoted/util/Var.scala index b08719f2e4c9..e5085aa7edaa 100644 --- a/library/src-bootstrapped/scala/quoted/util/Var.scala +++ b/library/src-bootstrapped/scala/quoted/util/Var.scala @@ -17,17 +17,17 @@ object Var { /** Create a variable initialized with `init` and used in `body`. * `body` recieves a `Var[T]` argument which exposes `get` and `update`. * - * Var('(7)) { + * Var('{7}) { * x => '{ - * while(0 < $x.get) - * $x.update('($x.get - 1)) - * $x.get + * while(0 < ${x.get}) + * ${x.update('{${x.get} - 1})} + * ${x.get} * } * } * * will create the equivalent of: * - * { + * '{ * var x = 7 * while (0 < x) * x = x - 1