Smalltalk has a concept of blocks, which is a lightweight syntax for anonymous functions.
However, they have this marvellous property: you can return from the enclosing method! This makes them far more useful for things like iterating with early termination.
Related Posts
I'm changing method definition syntax in my language:
// old
fun (this: Int) inc(): Int { this + 1 }
// new
method inc(this: Int): Int { this + 1 }
The original syntax was inspired by Go, but the new syntax is more grep-friendly and perhaps more readable. Not sure about the verbosity though. Thoughts?
Playing with Claude and my new programming language has made me add features that it wants. I think they're reasonable.
`for method in methods` -- custom syntax error explaining that `method` is a reserved word
`echo 'println("hello world")' | garden` -- eval snippets from stdin
I like that most LLM UIs show your previous queries prominently.
When figuring out where LLMs are useful in your workflow, it's nice to see what worked well (or not) in the past.
Web search doesn't have this property. I rarely look at what I've previously googled.