[erlang-questions] Binary pattern matching

Valentin Micic v@REDACTED
Sat Oct 19 19:23:54 CEST 2019


Indeed, Peti, you are correct… Thanks for the reminder. In fact, this makes a perfect sense :-)

Kind regards

V/

> On 19 Oct 2019, at 19:00, Peti Gömöri <gomoripeti@REDACTED> wrote:
> 
> 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 <mailto: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 <mailto:erlang-questions@REDACTED>
> http://erlang.org/mailman/listinfo/erlang-questions <http://erlang.org/mailman/listinfo/erlang-questions>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20191019/8f6c39d8/attachment.htm>


More information about the erlang-questions mailing list