fuzion-lang.dev — The Fuzion Language Portal
JavaScript seems to be disabled. Functionality is limited.
Fuzion
•
Idioms
•
Idiom # 223: for else loop
Idiom # 223: for else loop
See
programming-idioms.org
:
Code
for item in items until item = "rockstar programmer" say "found it!" else say "did not find it"
What are effects?
Running Example
ex223 is find(items array String) => for item in items until item = "rockstar programmer" say "found it!" else say "did not find it" fill i32 -> String := i -> if i=666 then "rockstar programmer" else "n00b" find (array 0 fill) find (array 10 fill) find (array 100 fill) find (array 1000 fill)
What are effects?
last changed: 2024-07-01
next: Idiom # 224: Add element to the beginning of the list