Assume that I have a code like:
val pf: PartialFunction[String, Unit] =
"string" match { case regex(g1, g2, _*) =>
function(g1, g2)
}
pf
has methods isDefinedAt
and apply
. Will the regex search be evaluated once, in isDefinedAt
point, or the job will be done twice?
If once, how args g1, g2
get passed to apply
method?