[erlang-bugs] error in R12B Efficiency Guide

Richard Carlsson richardc@REDACTED
Fri Jan 25 09:55:40 CET 2008


Zvi wrote:
> is there is some built-in mechanism for testing if expression matching the
> pattern?
> Something like this:
> 
> -define(IS_MATCH(Pattern,Expr), ((fun(Pattern) -> true; (_) -> false
> end)(Expr))).

No, nothing built-in. But your macro should work fine. Using the 'inline'
flag when you compile should get rid of the run-time fun calls.

     /Richard





More information about the erlang-bugs mailing list