Created
September 2, 2021 17:38
-
-
Save kubukoz/9381aead876da4f1bea272a0dd02260d to your computer and use it in GitHub Desktop.
example of a `named` macro in Scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def demo = { | |
def foo(a: Int, b: Int) = s"foo(a = $a, b = $b)" | |
val a = 42 | |
val b = 50 | |
Macros.named(foo(b, a)) | |
} | |
demo | |
// res0: String = "foo(a = 42, b = 50)" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment