Failure in Verse
Failure
Failure is control flow in Verse.
Failure is control flow in Verse.
Unlike other programming languages that use the Boolean values true and false to change the flow of a program, Verse uses expressions that can either succeed or fail. These expressions are called failable expressions, and can only be executed in a failure context.
Using failure for control flow means that work doesn’t have to be duplicated, and that you can avoid subtle errors.
For example, in other languages, you have to check that an index for an array is valid before accessing the array element at that index, which is a common cause of errors in other languages.
In Verse, validation and access are combined to avoid this.
You're reading a preview
The full reference is free for BrainDeadGuild Discord members — sign in to read it all, or open the original at the source.
Sign in with your BrainDead.TV / BrainDeadGuild Discord account for full access.