flang.dev — The Fuzion Language Portal
JavaScript seems to be disabled. Functionality is limited.
Fuzion
•
Idioms
•
Idiom # 195: Pass a two-dimensional array
Idiom # 195: Pass a two-dimensional array
See
programming-idioms.org
:
Code
foo a foo (a array2 f64) unit is say "array size {a.length0}×{a.length1}" for s := 0.0, s + v * (i.as_f64 + 1) * (j.as_f64 + 1) # NYI syntax sugar for tuples not supported, should be # # (i,j,v) in a.enumerate2 e in a.enumerate2 i := e.values.0 j := e.values.1 v := e.values.2 else say "sum is $s"
What are effects?
Running Example
ex195 is a := array2 5 7 i,j->3.14 foo a foo (a array2 f64) unit is say "array size {a.length0}×{a.length1}" for s := 0.0, s + v * (i.as_f64 + 1) * (j.as_f64 + 1) # NYI syntax sugar for tuples not supported, should be # # (i,j,v) in a.enumerate2 e in a.enumerate2 i := e.values.0 j := e.values.1 v := e.values.2 else say "sum is $s"
What are effects?
next: Idiom # 196: Pass a sub-array