Skip to content

Commit

Permalink
Update to moonc v0.1.20241216+68e710374
Browse files Browse the repository at this point in the history
Signed-off-by: Glenn Lewis <[email protected]>
  • Loading branch information
gmlewis committed Dec 17, 2024
1 parent 32c1ee3 commit 6d2de2f
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 24 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
10 changes: 4 additions & 6 deletions examples/arrays/floats.mbt
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
}
10 changes: 4 additions & 6 deletions examples/arrays/ints.mbt
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
}
14 changes: 6 additions & 8 deletions examples/arrays/strings.mbt
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
}
2 changes: 1 addition & 1 deletion moon.mod.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down

0 comments on commit 6d2de2f

Please sign in to comment.