https://stevelosh.com/blog/2018/07/fun-with-macros-if-let/ is an excellent post on implementing if-let and when-let macros.
It discusses the different ways you could expand the code, and ensuring the macro composes with other (Common) Lisp features.
Really useful macro too, I'm a big fan of the elisp equivalent.
Related Posts
I'm trying to decide the best voice for PL documentation.
Passive: "`let` can be used with destructuring."
Reader focused: "You can use `let` with destructuring."
Describing the PL: "FooLang supports destructuring with `let`."
Anyone have opinions or best practices?
I've been compilation buffers in Emacs recently and I really appreciate the error and warning counts shown in the modeline.
I've added the equivalent feature to deadgrep: it shows result counts! Really useful when you're doing big refactorings.
https://github.com/Wilfred/deadgrep
I really like pattern matching in Rust, but I find myself using it less and less.
`if let` and `let ... else` require substantially less indentation, and I often use them for Option values.
I don't miss this syntactic sugar in OCaml though. Maybe it's just because OCaml has a 2 space indent, unlike Rust's 4 space indent?