Reading thru the
Programming in Scala 4ed, in 26.7 “What’s more, every regular expression in Scala defines an extractor.”
and in the example:
val Decimal = """(-)?(\d+)(\.\d*)?""".r val Decimal(sign, integer part, decimal part) = "-1.23"
my question is how does that
unapply method get defined for each Decimal object? Thru some runtime magic?