-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update to moonc v0.1.20241216+68e710374
Signed-off-by: Glenn Lewis <[email protected]>
- Loading branch information
Showing
5 changed files
with
18 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,9 @@ | ||
///| `process_floats` sums up an array of floats. | ||
pub fn process_floats(floats : Array[Double]) -> Array[Double] { | ||
let mut sum = 0.0 | ||
floats.eachi( | ||
fn(index, value) { | ||
sum += value | ||
floats[index] = sum | ||
}, | ||
) | ||
floats.eachi(fn(index, value) { | ||
sum += value | ||
floats[index] = sum | ||
}) | ||
floats | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,9 @@ | ||
///| `process_ints` sums up an array of ints. | ||
pub fn process_ints(ints : Array[Int]) -> Array[Int] { | ||
let mut sum = 0 | ||
ints.eachi( | ||
fn(index, value) { | ||
sum += value | ||
ints[index] = sum | ||
}, | ||
) | ||
ints.eachi(fn(index, value) { | ||
sum += value | ||
ints[index] = sum | ||
}) | ||
ints | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,11 @@ | ||
///| `process_strings` concatenates an array of strings. | ||
pub fn process_strings(strings : Array[String]) -> Array[String] { | ||
let parts = [] | ||
strings.eachi( | ||
fn(index, value) { | ||
parts.push(value) | ||
// strings[index] = parts.join("|") | ||
// Yuck! https://github.com/moonbitlang/core/pull/993 | ||
strings[index] = String::concat(parts, separator="|") | ||
}, | ||
) | ||
strings.eachi(fn(index, value) { | ||
parts.push(value) | ||
// strings[index] = parts.join("|") | ||
// Yuck! https://github.com/moonbitlang/core/pull/993 | ||
strings[index] = String::concat(parts, separator="|") | ||
}) | ||
strings | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters