diff options
| author | SekoiaTree <51149447+SekoiaTree@users.noreply.github.com> | 2023-04-25 11:18:27 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-04-25 11:18:27 +0200 |
| commit | efad1e71fa699e0d2413d3a6a3ce5a4163e38112 (patch) | |
| tree | 64dd37c540989e71408ee005abdccdb523d76618 /src/eval/methods.rs | |
| parent | 12129f01707a3389ef90a4c78a872e1c7897a752 (diff) | |
Add sum and product to arrays (#966)
Diffstat (limited to 'src/eval/methods.rs')
| -rw-r--r-- | src/eval/methods.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/eval/methods.rs b/src/eval/methods.rs index 56d1c7b7..29b729cb 100644 --- a/src/eval/methods.rs +++ b/src/eval/methods.rs @@ -105,6 +105,8 @@ pub fn call( "fold" => { array.fold(vm, args.expect("initial value")?, args.expect("function")?)? } + "sum" => array.sum(args.named("default")?, span)?, + "product" => array.product(args.named("default")?, span)?, "any" => Value::Bool(array.any(vm, args.expect("function")?)?), "all" => Value::Bool(array.all(vm, args.expect("function")?)?), "flatten" => Value::Array(array.flatten()), |
