FAQ Database Discussion Community

Scala recursive macro?

I was wondering whether Scala supports recursive macro expansion e.g. I am trying to write a lens library with a lensing macro that does this: case class C(d: Int) case class B(c: C) case class A(b: B) val a = A(B(C(10)) val aa = lens(a)(_.b.c.d)(_ + 12) assert(aa.b.c.d == 22)...

Scala Macro: Create new classes with Option types

I want to write a macro given this: @MetaRest case class User( @get id : Int, @get @post @patch name : String, @get @post email : String, registeredOn : DateTime ) Generate the following piece of code: object User { case class Get(id: Int, name: String, email: String) case class...