flang.dev — The Fuzion Language Portal
JavaScript seems to be disabled. Functionality is limited.
Fuzion
•
Idioms
•
Idiom # 196: Pass a sub-array
Idiom # 196: Pass a sub-array
See
programming-idioms.org
:
Code
# fuzion arrays are immutable, we need to use marray instead a := (marray i32).type.new 10 0 a.indices | (i -> a[i] := i) a.indices & (i -> !(i%%2)) | (i -> foo a i)
What are effects?
Running Example
ex196 is foo (a marray i32, i i32) unit is a[i] := 42 a := (marray i32).type.new 10 0 a.indices | (i -> a[i] := i) say a a.indices & (i -> !(i%%2)) | (i -> foo a i) say a
What are effects?
next: NYI: Idiom # 197: Get a list of lines from a file