title: Macro taking a class body, eliminating explicit new operator?
body: <p>I never liked the <code>new</code> operator in Scala, particularly for DSLs. The workarounds for constructing objects <em>without</em> <code>new</code> are usually quite ugly. For instance, if you import <code>scala.actors.Actor._</code>, you have <code>actor { ... }</code>, but inside the body you are not having access to <code>this: Actor</code>, so there is all sorts of pseudo instance methods in that object, too, like <code>receive</code>, <code>react</code>, <code>self</code>, etc.</p>
  
  <p>With Scala 2.10 macros, I wonder if there is a chance to get the following working?</p>
  
  <pre><code>object Button {
    def apply(body: ? ): Button = macro applyImpl(body)
    def applyImpl(c: Context)(body: c.Expr[ ? ]): c.Expr[Button] = ?
  }
  trait Button {
    def text: String
    def text_=(s: String): Unit
    def doSomething(): Unit
  }
  
  Button {
    text = "test"
    doSomething()
  }
  </code></pre>
  
  <p>As an additional challenge, what happens if <code>doSomething</code> is <code>protected</code>?</p>