by codewright · 13y ago · 0 comments
He mentions that core.match is better at efficiently compiling complicated patterns, but little else is said as to exactly why strucjure was made rather than just using core.match.
Strucjure has much more expressive power. Strucjure views are first-class values and can call other views (or recursively call themselves). This allows them to recognise eg context free grammars. Most of the examples in this post cannot be expressed with core.match
Currently, this power comes at the expense of speed but I hope to be able to get reasonably close to core.match for simple patterns. Core.match will always be somewhat faster because it can reorder decisions and eliminate redundant tests.
The generality of Strucjure should not be underestimated :)
(match exp
[([not ([or & rest] :seq)] :seq)] ...)
From the looks of it, solving this problem using strucjure might be a little more elegant.