Clojure Records and Protocols tutorial

Поділитися
Вставка
  • Опубліковано 25 гру 2024

КОМЕНТАРІ • 15

  • @YihanPanFloria
    @YihanPanFloria 4 місяці тому

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

  • @LucasBatistussi
    @LucasBatistussi 2 роки тому +4

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

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

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

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

  • @andibensisva2155
    @andibensisva2155 3 роки тому +2

    Hooray..!

  • @eugenej.5584
    @eugenej.5584 3 роки тому +2

    There also is *reify*

  • @inanitas
    @inanitas 2 роки тому +2

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

    • @onthecodeagain
      @onthecodeagain  2 роки тому +5

      Thanks for watching :) I do what I like!