Elixir Protocols: a gentle introduction

Поделиться
HTML-код
  • Опубликовано: 22 ноя 2024

Комментарии • 19

  • @delamberty
    @delamberty Год назад +1

    This is wonderful! With protocols one can achieve L in SOLID principles.
    I feel like, now I get what protocols are in Elixir.

  • @hurolinci5986
    @hurolinci5986 3 года назад +1

    I had difficulty understanding from the book I was reading. Seeing a very good example like in your video made it clear as day.

    • @AlchemistCamp
      @AlchemistCamp  3 года назад +1

      Excellent! I'm happy to hear that!

  • @bigmaster1292
    @bigmaster1292 6 лет назад +1

    thank you for your contributions .

  • @delamberty
    @delamberty Год назад +1

    Can you define protocol in its own file and implement it in different modules?

    • @AlchemistCamp
      @AlchemistCamp  Год назад

      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.

  • @tarcisiooliveira6839
    @tarcisiooliveira6839 4 года назад +1

    Thank you

  • @CorySchmitt
    @CorySchmitt 6 лет назад +1

    Great video. Thanks for that!

  • @corey4448
    @corey4448 2 года назад +1

    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)

    • @AlchemistCamp
      @AlchemistCamp  2 года назад

      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?

    • @corey4448
      @corey4448 2 года назад

      @@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

    • @127highstreet
      @127highstreet Год назад

      Kernel.defgelegate kind(arg), to: Animal.Any worked for me. I would like to know why. I hope this helps!

  • @elxproBR
    @elxproBR 4 года назад +1

    Can I translate your material for my channel?

    • @AlchemistCamp
      @AlchemistCamp  4 года назад +1

      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.

    • @elxproBR
      @elxproBR 4 года назад

      @@AlchemistCamp Sorry, it was just this video. My mistake when I told it. Of course. I am gonna send an email

    • @AlchemistCamp
      @AlchemistCamp  4 года назад

      @@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).

    • @elxproBR
      @elxproBR 4 года назад

      @@AlchemistCamp Great!