[erlang-questions] literal character syntax

Karolis Petrauskas k.petrauskas@REDACTED
Wed May 14 16:45:52 CEST 2014


Never saw a contruct like this. Can you explain this syntax in more details?

Karolis


On Wed, May 14, 2014 at 5:41 PM, Magnus Henoch
<magnus@REDACTED>wrote:

> Sean Cribbs <sean@REDACTED> writes:
>
> > They are incredibly useful in pattern-matching simple string arguments.
> e.g.
> >
> > case erlang:system_info(version) of
> >     [$5, $., $1, $0 | _ ] -> ok;
> >     _ -> fail
> > end
>
> In this case, you could in fact write it like this instead:
>
> case erlang:system_info(version) of
>     "5.10" ++ _ -> ok;
>     _ -> fail
> end
>
> Regards,
> Magnus
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20140514/177946c5/attachment.htm>


More information about the erlang-questions mailing list