[erlang-questions] Binary pattern matching

Peti Gömöri gomoripeti@REDACTED
Sat Oct 19 19:00:01 CEST 2019


hi Valentin,

Maybe you remember the case when Offset was bound within the binary?
<<Offset, _:Offset/binary, Value/binary>>

On Sat, Oct 19, 2019 at 8:39 AM Valentin Micic <v@REDACTED> wrote:

> My sincere apology if this has been discussed before…
> I vaguely remember that a number of years ago, one was able to write
> something like this:
>
> *some_function( Offset, <<_:Offset/binary-unit:8, Value/binary>> ) -> …*
>
> without (Erlang R21.1) compiler complaining with: *variable Offset
> unbound*
>
> Was I dreaming?
>
> Thanks in advance
>
> V/
>
> _______________________________________________
> 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/20191019/d9ad8f28/attachment.htm>


More information about the erlang-questions mailing list