Defmacro Clojure Tutorial - Code that writes code

Опубликовано: 01 Октябрь 2024
на канале: Daniel Amber
3,377
218

Defmacro in Clojure allows you to write code that outputs code 🤯

This is a video on how to create and expand macros

Code: https://gist.github.com/danownsthissp...
Blog post: https://daniel-amber.com/blog/posts/c...

00:00 intro
00:10 what are macros?
00:45 create a function that delays the return
01:55 create a function that records the time taken
04:05 Syntax Quoting
05:24 Convert time-taken function to macro
07:10 Cater for multiple expressions to be passed through to time-taken
09:50 Begging for subs