[erlang-questions] examples for erlang with joins
Richard O'Keefe
ok@REDACTED
Mon Mar 9 02:36:04 CET 2009
On 9 Mar 2009, at 1:04 am, Zvi wrote:
{mochiweb has}
>
> -define(IS_WHITESPACE(C),
> (C =:= $\s orelse C =:= $\t orelse C =:= $\r orelse C =:= $\n)).
>
> f(C) when IS_WHITESPACE(C) -> ...
Given that we have '=:=' and 'orelse' and 'length',
it wouldn't be much of a change to Erlang to allow
member(C, " \t\r\n") in a guard.
>
> I would suggest some better syntax/operator instead of "and"
> keyword, like:
>
> f(C = ($\s ^ $\t ^ $\r ^ $\n) ) -> ...
Syntax we _already_ have would be even better.
I looked at the Mochiweb code recently. My first reaction
was to ask for member/2 in guards; my second reaction was
that character classification predicates would probably be
more to the point.
But none of this really has anything to do with joins.
More information about the erlang-questions
mailing list