fuzion-lang.dev — The Fuzion Language Portal
JavaScript seems to be disabled. Functionality is limited.
Fuzion
•
Idioms
•
Idiom # 254: Replace value in list
Idiom # 254: Replace value in list
See
programming-idioms.org
:
Code
x¹ := x.map (e -> if e="foo" then "bar" else e)
What are effects?
Running Example
ex254 is x := ["foo", "bar", "fooo", "foo", "bar", "foo"] # NYI: With support for ? |, this would be # # x¹ := x.map (e -> e="foo" ? "bar" | e) # x¹ := x.map (e -> if e="foo" then "bar" else e) say x¹
What are effects?
last changed: 2024-07-01
next: Idiom # 255: Print set