import scala.reflect.runtime.universe._ import scala.tools.reflect.Eval object Test extends App { reify { case class Person(name: String, age: Int) /** An AddressBook takes a variable number of arguments * which are accessed as a Sequence */ class AddressBook(a: Person*) { private val people: List[Person] = a.toList /** Serialize to XHTML. Scala supports XML literals * which may contain Scala expressions between braces, * which are replaced by their evaluation */ def toXHTML =
Name | Age |
---|---|
{ p.name } | { p.age.toString() } |