TIL that Rust supports inline struct definitions! https://github.com/rust-lang/rust/commit/6d43225bfb08ec91f7476b76c7fec632c4a096ef#diff-1dfa77331261e81c069657949febee032512a702bfe5865d7993cfc9f577f2f3
They still need names, but it allows you to define structs only used in a single function.
miniblog.
Related Posts
When a tool supports both regular expressions and literal strings, which should be the default?
If you default to regex, users can match more strings than they realise (e.g. `foo.txt`) or less (e.g. `foo(bar)`).
I typically see regex as the default, but I prefer the opposite.
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?
After seeing yet another YAML dialect for controlling systems, I think we need a hierarchy of YAML dialect expressiveness.
(1) Has its own variable binding system.
(2) Supports if statements.
(3) Supports loops.
(4) Supports function definition.
2 seems to be the most common, but I've seen all of 1-3. Does level 4 exist in the wild yet?