diff options
| author | s-ol <s+removethis@s-ol.nu> | 2022-02-04 00:49:56 +0000 |
|---|---|---|
| committer | s-ol <s+removethis@s-ol.nu> | 2025-03-02 14:24:49 +0000 |
| commit | 68e7f4cb45a020a23dc7af5a2ae06250ec6814e1 (patch) | |
| tree | a5b2103dedf49cc404fb96d8461d297d37ce16f7 | |
| parent | docs/internals: mention Op:setup_out (diff) | |
| download | alive-68e7f4cb45a020a23dc7af5a2ae06250ec6814e1.tar.gz alive-68e7f4cb45a020a23dc7af5a2ae06250ec6814e1.zip | |
lib: fix array-/map
| -rw-r--r-- | alv-lib/array-.moon | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/alv-lib/array-.moon b/alv-lib/array-.moon index 1e7e781..e2d2233 100644 --- a/alv-lib/array-.moon +++ b/alv-lib/array-.moon @@ -255,8 +255,8 @@ Invokes `fn` once for each element in `array` and returns an array of the result tail = [L\push t\eval, scope for t in *tail] { array, fn } = tail - fndef = fn.result assert fn\type! == T.fndef, "fn has to be a fndef" + array_type = array\type! assert array_type.__class == Array, Error 'argument', "expected an Array" @@ -264,22 +264,22 @@ Invokes `fn` once for each element in `array` and returns an array of the result tag_o = @tag\clone Tag.parse tostring i tag_i = @tag\clone tag_o Cell tag_o, { - with Constant.literal T.fndef, fndef!, 'fn' - .meta = fndef.meta + Dummy fn\make_ref! Cell tag_i, { - Constant.literal T.opdef, get!, 'get' - Constant.literal array_type, array.result!, 'array' + Dummy.literal T.opdef, get! + Dummy array\make_ref! Constant.num i-1 } } tag = @tag\clone Tag.parse '-1' inner = Cell tag, { - Constant.literal T.opdef, array_constr, 'array' + Dummy.literal T.opdef, array_constr unpack invocations } - super inner\eval scope + node = inner\eval scope + super RTNode children: { array, fn, node }, result: node.result Constant.meta meta: |
