I really like Clojure's let syntax. It works well when you only have a single variable. In other lisps, this feels a little verbose:
(let ((my-var (foo)))
(bar foo))
I've seen a let1 macro used in books, but not in the wild.
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'm pretty impressed with Cursor: I've successfully asked it to perform codebase transforms in English, and it's worked!
E.g. "Replace all calls foo(..., true) with foo_immediate(...) define a foo_immediate function".
I'm still reading the diff and checking tests -- it's still AI after all.
It's odd how lazy evaluation is generally seen as a niche design choice, yet the vast majority of languages treat `foo() || bar()` as short-circuiting.