Skip to content

Commit 043afa9

Browse files
committed
Move subsection for lets on the correct place
1 parent 4686d19 commit 043afa9

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

docs/docs/reference/metaprogramming/macros.md

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -587,13 +587,4 @@ val a: Int = defaultOf("int")
587587
val b: String = defaultOf("string")
588588
```
589589

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-
599590
[More details](./macros-spec.html)

docs/docs/reference/metaprogramming/tasty-reflect.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,20 @@ def collectPatternVariables(tree: Tree)(implicit ctx: Context): List[Symbol] = {
139139
A `TreeTraverser` extends a `TreeAccumulator` and performs the same traversal
140140
but without returning any value. Finally a `TreeMap` performs a transformation.
141141

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+
142156
## TASTy Reflect API
143157

144158
TASTy Reflect provides the following types:

0 commit comments

Comments
 (0)