Parse Transform Question
Thu Mar 9 10:55:34 CET 2006
> -----Original Message-----
> From: owner-erlang-questions@REDACTED
> [mailto:owner-erlang-questions@REDACTED] On Behalf Of Pete Kazmier
> Can I use a parse transform to take code that looks like this:
> test() ->
> predicate1() -> do1();
> predicate2() -> do2();
> predicate3() -> do3()
No, you can't. This is because in order to be able to apply a parse
treansform, the original code must be syntactically valid Erlang code, and
the cond construct isn't.
Also, cond is now a reserved keyword, and a cond construct is coming soon in
a release near you.
You could write something like
fun(predicate1()) -> do1();
(predicate2()) -> do2();
(predicate3()) -> do3()
and use a parse transform for this one.
More information about the erlang-questions