rascal - In a visit expression, can the default be labeled like the cases? -
example:
visit(sometree) { case a:somenodea(_,_): handlenodea(a); default: handle(???); }
so want handle other cases using default
, how can this?
visit not support default because needs specific bind while visiting. instead can write pattern matches everything. example:
visit(sometree) { case node x : handlealltreelikethings(x); case str y(value x, value y) : handleallbinarytrees(y, x, y); case value x : handleallvalueswhatsoever(x); }
Comments
Post a Comment