[erlang-questions] Request feedback on example project

Theepan <>
Wed Feb 3 18:56:08 CET 2016


version({uuid, <<_:48, 0:4, _:12, 2:2, _:62>>}) ->

version({uuid, <<_:48, V:4, _:12, 2:2, _:62>>}) when V < 6 ->



On Wed, Feb 3, 2016 at 1:03 PM, Björn Gustavsson <> wrote:

> On Wed, Feb 3, 2016 at 8:10 AM, zxq9 <> wrote:
> >
> > There should never be a chance where 0 > V because V is
> > extracted from a match on bits:
> >
> >     version({uuid, <<_:48, V:4, _:12, 2:2, _:62>>})
> >             when V > 0 andalso V < 6 ->
>
> V > 0 means that V can't be 0...
>
> > Therefore the following should be just as safe:
> >
> >     version({uuid, <<_:48, V:4, _:12, 2:2, _:62>>})
> >             when V < 6 ->
>
> ... therefore the modification is not safe.
>
> /Björn
>
> --
> Björn Gustavsson, Erlang/OTP, Ericsson AB
> _______________________________________________
> erlang-questions mailing list
> 
> http://erlang.org/mailman/listinfo/erlang-questions
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20160203/46c3a5f6/attachment.html>


More information about the erlang-questions mailing list