Defmacro Clojure Tutorial - Code that writes code

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

КОМЕНТАРІ • 25

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

    Fun facts:
    1. Macro can have varied amount of arguments (like functions do)
    2. Inside macro you can get env bindings by inspecting &env variable (there is also &form var, but it is boring)
    3. You can define function and macro under the same name (symbol). It is useful for the cases when you want to run the macro(actually the function) with apply.
    4. Macro can be used for performance sake. For example, you might want to move some of a heavy calculation to the compile time. For this you can implement a macro that does the work and inlines the result.

  • @streamcityvideo9500
    @streamcityvideo9500 Рік тому +1

    Well done ! Enjoyed the interactive style of coding..

  • @Bbdu75yg
    @Bbdu75yg Рік тому +1

    Love the intro ! And excellent content !

  • @street.programmer
    @street.programmer 3 роки тому +4

    Awesome! one of the reasons why I wanted to learn Clojure.

  • @jaimegarza8826
    @jaimegarza8826 3 роки тому +1

    Nice intro to clojure macros.

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

    Very nice explanation.. Looking forward to the next video. Cheers

  • @robertsmme
    @robertsmme 3 роки тому +4

    I really love the way you explain things. Not found a need for macros in my work, but it was good to see one built up. Thanks. It would be good to have a video about handling complex nested structures, may be including specter?

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

    You are awesome.

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

    Wow!
    1. you can comment the entire function with #_
    2. # with ` instead of gensym
    Thanks

  • @diegonayalazo
    @diegonayalazo 3 роки тому +1

    Thanks!!

  • @romanostash822
    @romanostash822 3 роки тому +1

    Great example and explanation of Clojure macros!
    You could look at transient data structures at some point. Just a suggestion))

  • @T0neDeaf
    @T0neDeaf 3 роки тому +1

    Very nice and useful video! Thanks
    Notice that "println" (unlike str) already surround args with space, so you can rid of spaces in your srings.

  • @wwgg1139
    @wwgg1139 3 роки тому +1

    awesome! bookmarked :+1:

  • @fredconcklin1094
    @fredconcklin1094 2 роки тому +1

    Who's up for macros in Overtone with self writing music in artificial intelligence?

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

      I haven't heard of overtone before this! It needs a video!! Thanks man