DSL の次の式で括弧/括弧を削除できるようにしたいと考えています。
substitute ("hello {0}" using "world")
コードの残りの部分は次のようになります。
class Rule(format: String) {
def using(arggs: String*): Rule = { /* save the args */ return this }
def execute() = { /* substitute params */ }
}
def substitute(rule: Rule) = rule.execute()
implicit def makeRule(format: String) = new Rule(format)
apply() メソッドを試してみましたが、そのようにはできないと思います。私が使用できるscalaマジックはありますか?