Skip to content

Instantly share code, notes, and snippets.

@kubukoz
Created September 2, 2021 17:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kubukoz/9381aead876da4f1bea272a0dd02260d to your computer and use it in GitHub Desktop.
Save kubukoz/9381aead876da4f1bea272a0dd02260d to your computer and use it in GitHub Desktop.
example of a `named` macro in Scala
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