Apply capitalization before delegating insertion:Scala's
trait CapitalisePlugIn extends Doc {
abstract override def insert(x: Char, pos: Int): Unit = {
super.insert(x.toUpper, pos)
}
}Char.toUpper implements the hinted conversion and leaves ordinary nonletters unchanged. The stackable trait modification intercepts insertion without changing the position, result type or deletion behavior. Articles by others on the same topic
There are currently no matching articles.