Is it possible to parameterize a rule or strategy with a constructor name in Stratego?
Is it possible to parameterize a rule or strategy with a constructor name in Stratego?
I often end up writing a pattern similar to the example below and was wondering whether there is a cleaner way to avoid the duplication:
Asked by Danny Groenewegen on 29 September 2014 at 20:50combine-property-assignment(|name) : plist -> [p | rest] where (list, rest) := <partition(?PropertyAssignment(name,String(<id>)))> plist ; p := PropertyAssignment(name, String(<concat-strings> list)) combine-attribute(|name) : plist -> [p | rest] where (list, rest) := <partition(?Attribute(name,String(<id>)))> plist ; p := Attribute(name, String(<concat-strings> list))