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 @@ -586,13 +586,4 @@ val a: Int = defaultOf("int")
586586val b : String = defaultOf(" string" )
587587```
588588
589- ### Let
590-
591- ` scala.tasty.reflect.utils.TreeUtils ` offers a method ` let ` that allows us to
592- bind the ` rhs ` to a ` val ` and use it in ` body ` . Its definition is shown below:
593-
594- ``` scala
595- def let (rhs : Term )(body : Ident => Term ): Term
596- ```
597-
598589[ 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] = {
139139A `TreeTraverser` extends a `TreeAccumulator` and performs the same traversal
140140but 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
144158TASTy Reflect provides the following types :
You can’t perform that action at this time.
0 commit comments