fuzion-lang.dev — The Fuzion Language Portal
JavaScript seems to be disabled. Functionality is limited.
Fuzion
•
Idioms
•
Idiom # 123: Assert condition
Idiom # 123: Assert condition
See
programming-idioms.org
:
Fuzion supports contracts via pre- and post-conditions and checks. See:
Design by contract
Code
Code input
is_consistent := false check is_consistent
What are effects?
Running Example
Code input
ex123 is is_consistent := false check is_consistent # to control where and when the check is evaluated # several condition qualifiers may be used. # checked at run time, unless safety is turned off check safety: is_consistent # checked at run time if debugging is enabled check debug: is_consistent # checked at compile time, by static analysis tools check analysis: is_consistent # checked at run time. check pedantic: is_consistent # you may also define your own qualifier (checked at run time): # my_qualifier => true check my_qualifier: is_consistent
What are effects?
last changed: 2025-07-10
next: Idiom # 124: Binary search for a value in sorted array