diff --git a/README.md b/README.md index 67a58da..3086cec 100644 --- a/README.md +++ b/README.md @@ -527,9 +527,9 @@ The code has been updated to support compiler: ```bash $ moon version --all -moon 0.1.20241209 (2848796 2024-12-09) ~/.moon/bin/moon -moonc v0.1.20241210+3258bad5b ~/.moon/bin/moonc -moonrun 0.1.20241209 (2848796 2024-12-09) ~/.moon/bin/moonrun +moon 0.1.20241216 (b57ed1c 2024-12-16) ~/.moon/bin/moon +moonc v0.1.20241216+68e710374 ~/.moon/bin/moonc +moonrun 0.1.20241216 (b57ed1c 2024-12-16) ~/.moon/bin/moonrun ``` Use `moonup` to manage `moon` compiler versions: diff --git a/examples/arrays/floats.mbt b/examples/arrays/floats.mbt index 2210863..030e571 100644 --- a/examples/arrays/floats.mbt +++ b/examples/arrays/floats.mbt @@ -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 } diff --git a/examples/arrays/ints.mbt b/examples/arrays/ints.mbt index 8232014..8b934d9 100644 --- a/examples/arrays/ints.mbt +++ b/examples/arrays/ints.mbt @@ -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 } diff --git a/examples/arrays/strings.mbt b/examples/arrays/strings.mbt index 781e40f..9c7d80f 100644 --- a/examples/arrays/strings.mbt +++ b/examples/arrays/strings.mbt @@ -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 } diff --git a/moon.mod.json b/moon.mod.json index 3a5266e..5260fb4 100644 --- a/moon.mod.json +++ b/moon.mod.json @@ -1,6 +1,6 @@ { "name": "extism/moonbit-pdk", - "version": "0.45.0", + "version": "0.46.0", "deps": {}, "readme": "README.md", "repository": "https://github.com/extism/moonbit-pdk",