[erlang-questions] Request feedback on example project

zxq9 zxq9@REDACTED
Wed Feb 3 08:34:51 CET 2016


On 2016年2月3日 水曜日 08:33:28 you wrote:
> On Wed, Feb 3, 2016 at 8:10 AM, zxq9 <zxq9@REDACTED> 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.

Indeed!

<facepalm/>

...coffee...



More information about the erlang-questions mailing list