File tree Expand file tree Collapse file tree 2 files changed +14
-9
lines changed
docs/docs/reference/metaprogramming Expand file tree Collapse file tree 2 files changed +14
-9
lines changed Original file line number Diff line number Diff line change @@ -587,13 +587,4 @@ val a: Int = defaultOf("int")
587
587
val b : String = defaultOf(" string" )
588
588
```
589
589
590
- ### Let
591
-
592
- ` scala.tasty.reflect.utils.TreeUtils ` offers a method ` let ` that allows us to
593
- bind the ` rhs ` to a ` val ` and use it in ` body ` . Its definition is shown below:
594
-
595
- ``` scala
596
- def let (rhs : Term )(body : Ident => Term ): Term
597
- ```
598
-
599
590
[ More details] ( ./macros-spec.html )
Original file line number Diff line number Diff line change @@ -139,6 +139,20 @@ def collectPatternVariables(tree: Tree)(implicit ctx: Context): List[Symbol] = {
139
139
A `TreeTraverser` extends a `TreeAccumulator` and performs the same traversal
140
140
but without returning any value. Finally a `TreeMap` performs a transformation.
141
141
142
+ #### Let
143
+
144
+ `scala.tasty.reflect.utils.TreeUtils` also offers a method `let` that allows us
145
+ to bind the `rhs` to a `val` and use it in `body`. Additionally , `lets` binds
146
+ the given `terms` to names and use them in the `body`. Their type definitions
147
+ are shown below :
148
+
149
+ ```scala
150
+ def let (rhs : Term )(body : Ident => Term ): Term = ...
151
+
152
+ def lets (terms : List [Term ])(body : List [Term ] => Term ): Term = ...
153
+ ```
154
+
155
+
142
156
## TASTy Reflect API
143
157
144
158
TASTy Reflect provides the following types :
You can’t perform that action at this time.
0 commit comments