[erlang-questions] pattern match test operator
Andras Georgy Bekes
Tue Dec 4 21:24:08 CET 2007
> Parse transforms happen at compilation time. What is your reasoning
> behind "slower than a compiled implementation"?
I just think the compiler might generate more efficient code if it
_knows_ that it is doing only a pattern match and nothing else. The
code I've written also contains calls to erlang:error/1. OK it is a
BIF, but still, I think a match failure is just faster than calling
erlang:error (and building up its argument).
But, the point is not this. The point is that a parse-transform
implementation of the stuff is almost useless, because it cannot be
used in function heads and case and receive expressions.
More information about the erlang-questions