Caterpillar

Daily Thought - 2024-06-24

< back to list

Caterpillar allows you to bind values to names. You can also bind multiple values in one go.

Here's some pseudocode to demonstrate that (remember, Caterpillar has no syntax yet):

5 2 divide_integers => result remainder .

Here, we call a function that returns two values, and bind them both to names in a single binding operation. In fact, we have to bind them both. We are not allowed to leave any unnamed operands behind. That would currently result in a runtime error.

This rule improves the clarity of the code and prevents mistakes, as you can't accidentally carry over any unnamed operands to the next operation. Maybe this is too limiting and will change in the future, but for now, that's how it works.

<< previous thoughtnext thought >>