Clojure Records and Protocols tutorial

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

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

  • @YihanPanFloria
    @YihanPanFloria 5 месяцев назад

    really helpful, from somebody who just started to learn clojure!

  • @viniciusataidedealbuquerqu2837
    @viniciusataidedealbuquerqu2837 3 года назад +6

    protocols are awesome for documenting boundaries functionalities that you need to test/modularize

  • @romanostash822
    @romanostash822 3 года назад +7

    Keep them coming! Great job creating Clojure tutorials! Short and to the point.

  • @LucasBatistussi
    @LucasBatistussi 3 года назад +4

    Summarizing: defrecord is for adding properties using composition and defprotocol to add methods using composition! Damn! Every time I like Clojure ideas more !

  • @eugenej.5584
    @eugenej.5584 3 года назад +6

    The funcool
    /cats project uses protocols and records to implement CT stuff in Clojure at type level. They have great docs and some of the stuff pretty useful, for example, Exception monad for dealing with exceptions in more "civilized" manner

    • @onthecodeagain
      @onthecodeagain  3 года назад

      Woah, I've never heard of that lib before, seems useful and also nice docs!

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

    This video helped me so much. Thank you for making this!!

    • @onthecodeagain
      @onthecodeagain  3 года назад

      Awesome! Happy it helped :) thanks for watching!

  • @eugenej.5584
    @eugenej.5584 3 года назад +2

    There also is *reify*

  • @andibensisva2155
    @andibensisva2155 3 года назад +2

    Hooray..!

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

    Is extend-protocol always necessary? extend-protocol seems to be confusing when implemented outside the defrecord form. What would be the problem while implementing the Display protocol in the Product defrecord like the following?
    (defrecord Product [name]
    Display
    (title [this] (str "This product is a " name))
    (description [this descr] (str "The " name " is " descr)))

  • @inanitas
    @inanitas 2 года назад +2

    Nice video, thank you. But please, don't do these sensationalized thumbnails lol. You're not a kiddo RUclipsr.

    • @onthecodeagain
      @onthecodeagain  2 года назад +5

      Thanks for watching :) I do what I like!