Crosscut

Daily Thought - 2024-06-24

Hey, I'm Hanno! These are my daily thoughts on Crosscut, the programming language I'm creating. If you have any questions, comments, or feedback, please get in touch!

This thought was published before Crosscut was called Crosscut! If it refers to "Caterpillar", that is the old name, just so you know.

< 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 >>

Hey, you! Want to subscribe to my daily thoughts? Just let me know (maybe include a nice message, if you're up for it), and I'll send you an email whenever I post a new one.