<div dir="ltr">I made a cheat sheet for binaries that you may find useful: <a href="https://cheatography.com/fylke/cheat-sheets/erlang-binaries/">https://cheatography.com/fylke/cheat-sheets/erlang-binaries/</a><div><br></div><div>Improvement suggestions welcome!</div><div><br></div><div>Regards,<br>Magnus</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Oct 21, 2021 at 9:21 AM Nalin Ranjan <<a href="mailto:ranjanified@gmail.com">ranjanified@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">If you prefer chatting, there is a link to get a <a href="https://erlef.org/slack-invite/erlanger" target="_blank">slack</a> invitation under the <a href="https://www.erlang.org/community" target="_blank">community</a> section of <a href="http://erlang.org" target="_blank">erlang.org</a>.<div><br></div><div>Thanks and Regards</div><div>Nalin Ranjan</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Oct 21, 2021 at 9:37 AM Felipe Vieira <<a href="mailto:fmv1992@gmail.com" target="_blank">fmv1992@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="rtl"><div dir="ltr">Hey folks, I have just started learning Erlang and I'm loving it.<br><br>I'm going through Armstrong's "Programming Erlang" and I'm trying to build on "Reading MP3 Metadata".<br><br>He patter matches with:<br><br>```<br>parse_v1_tag(<<$T,$A,$G, Title:30/binary, Artist:30/binary, ⋯<br>```<br><br>I tried the following (and variations):<br><br>1.<br><br>```<br>-define(ID3V2_HEADER, "TAG").<br>⋯<br>is_id3v2(<<?ID3V2_HEADER, Tag:(128 - byte_size(?ID3V2_HEADER))/binary>>) -><br>```<br><br>2.<br><br>```<br>-define(ID3V2_HEADER, <<"TAG":3/binary>>).<br>⋯<br>is_id3v2(<<?ID3V2_HEADER, Tag:(128 - byte_size(?ID3V2_HEADER))/binary>>) -><br>```<br><br>And I'm trying to achieve a match like this (which also does not work, but states more clearly my intentions):<br><br>```<br><<"TAG">> ++ <<X>> = <<84,65,71,73,86,46,32,87,46>>.<br>```<br></div><div dir="ltr"><br></div><div dir="ltr">Is there a way to achieve this together with the `128 - byte_size(?ID3V2_HEADER))/binary>>` calculation?<br></div><div dir="ltr"><br>Best,<br><br>PS: is there a more informal/chat-like place to ask these kinds of questions?<br></div></div>
</blockquote></div>
</blockquote></div>