You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@nicolasstucki@lihaoyi I understand that changing seal/unseal to Term.of and .asExprOf makes sense internally, especially since it avoid the need for an extra call (i.e. in x.seal.cast[T]). For new users for Tasty Reflect however, the mental-model of "sealing" and "unsealing" is beautifully intuitive and makes the whole Term <-> Expr duality much, much easier to understand. Several students to whom I have taught Tasty-Reflect have told me this. Is there any possibility that the following could be added for user-convenience?
expr.unseal // as a shortcut for Term.of(expr)
term.sealAs[T] // as a shortcut for term.asExprOf[T]
term.seal // as a shortcut for term.asExprOf[Any]
Normally I would just add these things in my own codebase as extension classes but Quotes being a path-dependent variable makes this very difficult to do.