Thanks Joep! There is a problem linking directly to the function. I can’t do it or it corrupts the rendering. 🙁 The function I’m referring to is <<>>/1
I’ve fixed the rendering problem but at the cost of a less precise link.
Wow this help me a lot, I always don’t understand well when I see something about binary using elixir.
Now this opens my mind.
Thank you so much, your explanations are awesome!
i will now read on Documentation about this <> and be prepared.
These lessons are proving to be very helpful for me. I was surprised to find that the rest of the binary data does not match unless ::binary is appended.
def image_type(<>), do: :png doesn’t work but
def image_type(<>), do: :png does work
Hello Vitaly! Can you be more specific? I just tested using Elixir 1.12.1 (current latest released version) and all the tests pass without a need to change.
The link to https://hexdocs.pm/elixir/Kernel.SpecialForms.html in this article is displayed incorrectly.
Thanks Joep! There is a problem linking directly to the function. I can’t do it or it corrupts the rendering. 🙁 The function I’m referring to is <<>>/1
I’ve fixed the rendering problem but at the cost of a less precise link.
Wow this help me a lot, I always don’t understand well when I see something about binary using elixir.
Now this opens my mind.
Thank you so much, your explanations are awesome!
i will now read on Documentation about this <> and be prepared.
Awesome! I’m glad it is helpful!
These lessons are proving to be very helpful for me. I was surprised to find that the rest of the binary data does not match unless ::binary is appended.
def image_type(<>), do: :png doesn’t work but
def image_type(<>), do: :png does work
Thank you, Mark, for making this available.
1.13 elixir, little problem with 1 test, it is not accepting “SAY “, only “SAY” etc
Hello Vitaly! Can you be more specific? I just tested using Elixir 1.12.1 (current latest released version) and all the tests pass without a need to change.
Fixed by removing space in the test. 🙂
My tests passed doing this:
def image_type(@png_signature _image_body), do: :png
def image_type(@jpg_signature _image_body), do: :jpg
I see your solution is different. Is it the best way to do or just different? Why do both of them work?
The links from “Recap” were very helpful for me! Thanks a lot, Mark