I'm doing an assignment at the moment. I have the following classes:
Now, what I would like to achieve is a mapping of all my Expr classes
to a Set[String]. For each Exp I want to have a Set that gives me all
the Refs from Exp.
exp1 = Plus(Ref("A"). Literal(5))
then I would like to have exp1 mapped to the set ("A")
I have this function:
My question is: is there some handy way to get all case classes of the form '_(a,b)' treated in one go,
instead of casing them one by one as I do above? I tried: case _(a,b) => , but that was not allowed.
There are three kinds of actuaries: those who can count, and those who can't.