Caterpillar

Daily Thought - 2024-06-29

< back to list

I've been talking about changing binding statements, which modify the current scope, into binding expressions, which create a new scope. But there's a disadvantage to that technique.

What if, within the scope that your binding created, you need to create more bindings? Then you have a scope within a scope. Which could create another scope, and so on. If this nesting goes to deep, surely that will offset any advantage you get from not modifying the current scope.

I guess you can alleviate this by keeping your functions short, which seems like a good idea anyway. And there's probably lots to be learned by studying how this kind of thing is handled in languages like Haskell. Either way, I think this might be something I need to test for a while in Caterpillar, to see how it works out.

<< previous thoughtnext thought >>