Skip to contentSkip to conversation

Increasing awareness for short-circuit evaluation consequences by SmPL disjunctions?

cocci Markus Elfring 2 participants 3 messages Feb 5, 2025

lore
Share & tools
lore
#0 lore raw

Hello,

Disjunctions of the semantic patch language are using short-circuit evaluation. It has got the consequence that the last element of the specified condition will only be checked if all previous parts did not match. Such a technical detail can lead to a recommended ordering of condition parts if you would like to care for optimal run time characteristics of SmPL code.

The usage incidence might be unclear for involved case distinctions. How do you think about to clarify possibilities any further for the reordering of SmPL disjunction items?

Regards,
Markus

#1 lore raw
Quoted 11 lines · Markus Elfring

Hello,

Disjunctions of the semantic patch language are using short-circuit evaluation. It has got the consequence that the last element of the specified condition will only be checked if all previous parts did not match. Such a technical detail can lead to a recommended ordering of condition parts if you would like to care for optimal run time characteristics of SmPL code.

The usage incidence might be unclear for involved case distinctions. How do you think about to clarify possibilities any further for the reordering of SmPL disjunction items?

What is unclear? The disjunction branches are not reordered.

julia

#2 lore raw
Quoted 5 lines
Quoted 3 lines

The usage incidence might be unclear for involved case distinctions. How do you think about to clarify possibilities any further for the reordering of SmPL disjunction items?

What is unclear?

* How will chances evolve to improve the software documentation for mentioned functionality?

* How often can case distinctions actually be applied in an analysed source file?

Quoted 1 line

The disjunction branches are not reordered.

Are there system configuration and software development concerns to consider just because of short-circuit evaluation?

Regards,
Markus