plasma icon indicating copy to clipboard operation
plasma copied to clipboard

Short circuiting vs. full-evaluation in logical operators.

Open ACleverDisguise opened this issue 3 years ago • 0 comments

As discussed in channel, there are valid design and implementation considerations that would mandate short-circuiting operations and that would mandate not short-circuiting them. To this end, the language should have some means to mandate one or the other. A final proposal was thought of:

and: compiler decides and perhaps: short circuit and then: always evaluates both arguments

An syntaxes using sigils was also discussed:

and: compiler decides and?: short circuit and!: always evaluates both arguments

and: compiler decides and-: short circuit and+: always evaluates both arguments

This is not a critical feature by a long shot, but is one to keep in mind while implementing other features so that it is not inadvertently blocked when the time comes to think of it.

ACleverDisguise avatar Nov 09 '21 06:11 ACleverDisguise