Absolutely! You can also implement protocols you didn’t define, e.g., you can implement the Enumerable protocol for one of your own struct so you can use the functions in Enum on it.
Would be grateful for help! I'm having issue with defdelegate being declared inside defprotocol. It says "undefined function defdelegate/2 (there is no such import)". But there's no error when I put it inside, for example defmodule. (Elixir version is 1.13.4)
Sorry, I just now saw this. If you’re still facing the issue, could you comment on the episode page and include a link to a (hopefully minimal) repo with the issue?
@@AlchemistCamp Hi! Thank you for response, I don't see my prev comment (maybe was deleted because I gave a link) so here's my gist showing the issue ruxxzebre/4f5c1cec0cce473ba691d079452f37d8
Subtitles on all my videos are open to edit, but it doesn't really help much to have things copied to another channel. If you'd like to email me, though, maybe we can come up with an arrangement that's good for both our channels.
This is wonderful! With protocols one can achieve L in SOLID principles.
I feel like, now I get what protocols are in Elixir.
I had difficulty understanding from the book I was reading. Seeing a very good example like in your video made it clear as day.
Excellent! I'm happy to hear that!
thank you for your contributions .
They will continue!
Can you define protocol in its own file and implement it in different modules?
Absolutely! You can also implement protocols you didn’t define, e.g., you can implement the Enumerable protocol for one of your own struct so you can use the functions in Enum on it.
Thank you
Great video. Thanks for that!
Glad you found it useful!
Would be grateful for help!
I'm having issue with defdelegate being declared inside defprotocol. It says "undefined function defdelegate/2 (there is no such import)".
But there's no error when I put it inside, for example defmodule.
(Elixir version is 1.13.4)
Sorry, I just now saw this. If you’re still facing the issue, could you comment on the episode page and include a link to a (hopefully minimal) repo with the issue?
@@AlchemistCamp Hi! Thank you for response, I don't see my prev comment (maybe was deleted because I gave a link) so here's my gist showing the issue ruxxzebre/4f5c1cec0cce473ba691d079452f37d8
Kernel.defgelegate kind(arg), to: Animal.Any worked for me. I would like to know why. I hope this helps!
Can I translate your material for my channel?
Subtitles on all my videos are open to edit, but it doesn't really help much to have things copied to another channel.
If you'd like to email me, though, maybe we can come up with an arrangement that's good for both our channels.
@@AlchemistCamp Sorry, it was just this video. My mistake when I told it. Of course. I am gonna send an email
@@elxproBR No problem! If it's just this video, then I don't mind as long as you give credit link back to me (channel or site).
@@AlchemistCamp Great!