Lisp is the only language I've seen where it's idiomatic to have some locals scoped to the *middle* of a function. It's a consequence of let blocks.
It's neat, but I rarely miss it elsewhere. I'm happy with "scoped from here to the end of the block" in e.g. C or Rust.
miniblog.
Related Posts
Copilot was super helpful for changing some locals to lazy_static!:
let integer_re = Regex::new(...) // old
static ref INTEGER_RE = Regex::new(...) // new
Unfortunately, it added a $ to the end of my first regex! It saved me a ton of keystrokes, but needed careful checking.
Creating a new PL is so different from changing an existing one.
You need to worry about syntax, locals, scope, error checking, conditionals, interpreter loop, stdlib etc. You can work on these in isolation once you have a working implementation.
(My toy PL now does fizzbuzz!)
Creating a new PL is so different from changing an existing one.
You need to worry about syntax, locals, scope, error checking, conditionals, interpreter loop, stdlib etc. You can work on these in isolation once you have a working implementation.
(My toy PL now does fizzbuzz!)