eliscript 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/COPYING.RUNTIME +93 -0
- package/README.md +15 -3
- package/bin/eliscript-test +29 -0
- package/bootstrap/backends/README.md +5 -4
- package/bootstrap/backends/binary.eli +89 -22
- package/bootstrap/backends/capabilities.eli +9 -4
- package/bootstrap/backends/managed-layout.eli +93 -81
- package/bootstrap/backends/managed.eli +651 -125
- package/bootstrap/backends/native.eli +1791 -324
- package/bootstrap/backends/numeric.eli +71 -7
- package/bootstrap/backends/sha256.eli +165 -68
- package/bootstrap/backends/wasm.eli +461 -52
- package/bootstrap/compiler/analyzer.eli +692 -2
- package/bootstrap/compiler/compiler.eli +16 -3
- package/bootstrap/compiler/emitter.eli +80 -35
- package/bootstrap/compiler/project.eli +175 -1
- package/bootstrap/compiler/transient-analysis.eli +2 -2
- package/bootstrap/host/build.eli +1 -0
- package/bootstrap/host/build.mjs +1 -1
- package/bootstrap/host/build.mjs.map +1 -1
- package/bootstrap/host/bun.mjs +7 -9
- package/bootstrap/host/bun.mjs.map +1 -1
- package/bootstrap/host/check-cli-ground.eli +47 -5
- package/bootstrap/host/check-cli-ground.mjs +60 -19
- package/bootstrap/host/check-cli-ground.mjs.map +1 -1
- package/bootstrap/host/check-cli.mjs +41 -1
- package/bootstrap/host/check-cli.mjs.map +1 -1
- package/bootstrap/host/compiler-session.eli +136 -22
- package/bootstrap/host/eliscript-cli.mjs +1 -1
- package/bootstrap/host/eliscript-cli.mjs.map +1 -1
- package/bootstrap/host/evaluation-cli.eli +33 -1
- package/bootstrap/host/evaluation-cli.mjs +65 -28
- package/bootstrap/host/evaluation-cli.mjs.map +1 -1
- package/bootstrap/host/evaluation.eli +651 -42
- package/bootstrap/host/evaluation.mjs +884 -72
- package/bootstrap/host/evaluation.mjs.map +1 -1
- package/bootstrap/host/project-cli-ground.eli +6 -1
- package/bootstrap/host/project-cli-ground.mjs +33 -32
- package/bootstrap/host/project-cli-ground.mjs.map +1 -1
- package/bootstrap/host/project-cli.mjs +1 -1
- package/bootstrap/host/project-cli.mjs.map +1 -1
- package/bootstrap/host/project-ground.eli +266 -45
- package/bootstrap/host/project-ground.mjs +429 -159
- package/bootstrap/host/project-ground.mjs.map +1 -1
- package/bootstrap/host/project.mjs +30 -40
- package/bootstrap/host/project.mjs.map +1 -1
- package/bootstrap/host/test-cli.eli +379 -0
- package/bootstrap/host/test-cli.mjs +494 -0
- package/bootstrap/host/test-cli.mjs.map +1 -0
- package/browser/README.md +7 -0
- package/browser/host.mjs +21 -29
- package/browser/host.mjs.map +1 -1
- package/browser/worker.mjs +7 -9
- package/browser/worker.mjs.map +1 -1
- package/compiler/eliscript-analyzer.el +694 -0
- package/compiler/eliscript-cli.el +66 -22
- package/compiler/eliscript-emitter.el +67 -43
- package/compiler/eliscript-ir-emitter.el +71 -36
- package/compiler/eliscript-project.el +360 -80
- package/compiler/eliscript-transient-analysis.el +5 -5
- package/compiler/eliscript.el +6 -0
- package/dist/backends/binary.mjs +148 -26
- package/dist/backends/binary.mjs.map +1 -1
- package/dist/backends/capabilities.mjs +11 -4
- package/dist/backends/capabilities.mjs.map +1 -1
- package/dist/backends/elf.mjs +4 -4
- package/dist/backends/elf.mjs.map +1 -1
- package/dist/backends/managed-layout.mjs +53 -56
- package/dist/backends/managed-layout.mjs.map +1 -1
- package/dist/backends/managed.mjs +1116 -375
- package/dist/backends/managed.mjs.map +1 -1
- package/dist/backends/memory.mjs +24 -26
- package/dist/backends/memory.mjs.map +1 -1
- package/dist/backends/native.mjs +2529 -434
- package/dist/backends/native.mjs.map +1 -1
- package/dist/backends/numeric.mjs +140 -33
- package/dist/backends/numeric.mjs.map +1 -1
- package/dist/backends/optimize.mjs +2 -2
- package/dist/backends/optimize.mjs.map +1 -1
- package/dist/backends/regexp.mjs +33 -35
- package/dist/backends/regexp.mjs.map +1 -1
- package/dist/backends/sha256.mjs +159 -59
- package/dist/backends/sha256.mjs.map +1 -1
- package/dist/backends/wasm.mjs +609 -73
- package/dist/backends/wasm.mjs.map +1 -1
- package/dist/bootstrap/analyzer.mjs +1018 -2
- package/dist/bootstrap/analyzer.mjs.map +1 -1
- package/dist/bootstrap/compiler.mjs +30 -23
- package/dist/bootstrap/compiler.mjs.map +1 -1
- package/dist/bootstrap/emitter.mjs +206 -161
- package/dist/bootstrap/emitter.mjs.macro-origins.json +16 -16
- package/dist/bootstrap/emitter.mjs.map +1 -1
- package/dist/bootstrap/expander.mjs +27 -31
- package/dist/bootstrap/expander.mjs.map +1 -1
- package/dist/bootstrap/ir.mjs +22 -24
- package/dist/bootstrap/ir.mjs.map +1 -1
- package/dist/bootstrap/project.mjs +246 -1
- package/dist/bootstrap/project.mjs.map +1 -1
- package/dist/bootstrap/reader.mjs +2 -2
- package/dist/bootstrap/reader.mjs.map +1 -1
- package/dist/bootstrap/source-map.mjs +34 -48
- package/dist/bootstrap/source-map.mjs.map +1 -1
- package/dist/bootstrap/transient-analysis.mjs +2 -2
- package/dist/bootstrap/transient-analysis.mjs.map +1 -1
- package/dist/browser/compiler.js +106 -106
- package/dist/browser/host.mjs +21 -29
- package/dist/browser/loader.js +1 -1
- package/dist/browser/worker.mjs +95 -95
- package/dist/compiler-artifact.json +1 -1
- package/dist/host/compiler-session.mjs +405 -228
- package/dist/host/compiler-session.mjs.map +1 -1
- package/dist/host/compiler-tools.mjs +44 -46
- package/dist/host/compiler-tools.mjs.map +1 -1
- package/dist/literal-sources/runtime/core/array-map.eli +45 -0
- package/dist/literal-sources/runtime/core/collection-internals.eli +22 -2
- package/dist/literal-sources/runtime/core/collection.eli +282 -23
- package/dist/literal-sources/runtime/core/data-text.eli +196 -13
- package/dist/literal-sources/runtime/core/data.eli +1 -1
- package/dist/literal-sources/runtime/core/identifier.eli +1 -1
- package/dist/literal-sources/runtime/core/lazy-sequence.eli +822 -44
- package/dist/literal-sources/runtime/core/list.eli +1 -1
- package/dist/literal-sources/runtime/core/map.eli +1 -1
- package/dist/literal-sources/runtime/core/metadata-internals.eli +2 -2
- package/dist/literal-sources/runtime/core/metadata.eli +2 -2
- package/dist/literal-sources/{stdlib/core/object.eli → runtime/core/object-impl.eli} +6 -6
- package/dist/literal-sources/runtime/core/object.eli +1 -1
- package/dist/literal-sources/runtime/core/order.eli +3 -3
- package/dist/literal-sources/runtime/core/persistent-kind.eli +1 -1
- package/dist/literal-sources/{stdlib/core/protocol.eli → runtime/core/protocol-impl.eli} +2 -2
- package/dist/literal-sources/runtime/core/protocol.eli +5 -3
- package/dist/literal-sources/runtime/core/queue.eli +1 -1
- package/dist/literal-sources/runtime/core/record.eli +3 -3
- package/dist/literal-sources/runtime/core/regex.eli +2 -2
- package/dist/literal-sources/runtime/core/sequence.eli +1 -1
- package/dist/literal-sources/runtime/core/set-algebra.eli +1 -1
- package/dist/literal-sources/runtime/core/set.eli +1 -1
- package/dist/literal-sources/runtime/core/sorted.eli +4 -4
- package/dist/literal-sources/{stdlib/core/text.eli → runtime/core/text-impl.eli} +2 -2
- package/dist/literal-sources/runtime/core/text.eli +1 -1
- package/dist/literal-sources/runtime/core/transducer.eli +24 -2
- package/dist/literal-sources/runtime/core/transient.eli +7 -5
- package/dist/literal-sources/runtime/core/type.eli +1 -1
- package/dist/literal-sources/runtime/core/value-internals.eli +3 -3
- package/dist/literal-sources/runtime/core/value.eli +2 -2
- package/dist/literal-sources/runtime/core/vector.eli +5 -2
- package/dist/literal-sources/{stdlib → runtime/managed}/managed-literal-protocols.eli +100 -34
- package/dist/literal-sources/{stdlib → runtime/managed}/managed-literals.eli +406 -81
- package/{stdlib → dist/literal-sources/runtime/managed}/managed-queue-state.eli +1 -1
- package/{stdlib → dist/literal-sources/runtime/managed}/managed-sorted-state.eli +1 -1
- package/dist/literal-sources/runtime/managed/managed-transient-state.eli +1206 -0
- package/{stdlib → dist/literal-sources/runtime/managed}/managed-value-state.eli +30 -6
- package/dist/literal-sources/{stdlib → runtime/managed}/managed-vector-view-state.eli +1 -1
- package/dist/literal-sources/runtime/wire/http-rpc.eli +1 -1
- package/dist/literal-sources/runtime/wire/markdown.eli +1 -1
- package/dist/literal-sources/runtime/wire/schema.eli +1 -1
- package/dist/literal-sources/stdlib/bit.eli +89 -1
- package/dist/literal-sources/stdlib/data.eli +522 -0
- package/dist/literal-sources/stdlib/interop/object.eli +39 -0
- package/dist/literal-sources/stdlib/persistent-list.eli +60 -21
- package/dist/literal-sources/stdlib/persistent-map.eli +335 -324
- package/dist/literal-sources/stdlib/persistent-set.eli +8 -6
- package/dist/literal-sources/stdlib/persistent-vector.eli +18 -18
- package/dist/literal-sources/stdlib/protocol.eli +63 -0
- package/{stdlib/core → dist/literal-sources/stdlib}/set.eli +8 -8
- package/dist/literal-sources/stdlib/string.eli +362 -0
- package/dist/runtime/lisp/async-runtime.mjs +55 -59
- package/dist/runtime/lisp/async-runtime.mjs.map +1 -1
- package/dist/runtime/lisp/builtins.mjs +232 -280
- package/dist/runtime/lisp/builtins.mjs.map +1 -1
- package/dist/runtime/lisp/cli.mjs +159 -167
- package/dist/runtime/lisp/cli.mjs.map +1 -1
- package/dist/runtime/lisp/compiler.mjs +359 -419
- package/dist/runtime/lisp/compiler.mjs.map +1 -1
- package/dist/runtime/lisp/core.mjs +24 -24
- package/dist/runtime/lisp/core.mjs.map +1 -1
- package/dist/runtime/lisp/evaluator.mjs +315 -385
- package/dist/runtime/lisp/evaluator.mjs.map +1 -1
- package/dist/runtime/lisp/extensions.mjs +85 -103
- package/dist/runtime/lisp/extensions.mjs.map +1 -1
- package/dist/runtime/lisp/host-io.mjs +106 -122
- package/dist/runtime/lisp/host-io.mjs.map +1 -1
- package/dist/runtime/lisp/io-worker.mjs +117 -135
- package/dist/runtime/lisp/io-worker.mjs.map +1 -1
- package/dist/runtime/lisp/keymap.mjs +5 -5
- package/dist/runtime/lisp/keymap.mjs.map +1 -1
- package/dist/runtime/lisp/macros-forms.mjs +49 -51
- package/dist/runtime/lisp/macros-forms.mjs.map +1 -1
- package/dist/runtime/lisp/reader-format.mjs +31 -31
- package/dist/runtime/lisp/reader-format.mjs.map +1 -1
- package/dist/runtime/lisp/regexp-buffer.mjs +9 -9
- package/dist/runtime/lisp/regexp-buffer.mjs.map +1 -1
- package/dist/runtime/math.mjs +32 -38
- package/dist/runtime/math.mjs.map +1 -1
- package/dist/runtime/number-radix.mjs +5 -7
- package/dist/runtime/number-radix.mjs.map +1 -1
- package/dist/runtime/primitives.mjs +81 -46
- package/dist/runtime/primitives.mjs.macro-origins.json +294 -44
- package/dist/runtime/primitives.mjs.map +1 -1
- package/dist/runtime/unicode-case.mjs +6 -6
- package/dist/runtime/unicode-case.mjs.map +1 -1
- package/dist/runtime.eli +3068 -1882
- package/dist/stage3-release.json +1 -1
- package/dist/stdlib/async.mjs +1838 -0
- package/dist/stdlib/bit.mjs +116 -0
- package/dist/stdlib/collection.mjs +193 -0
- package/dist/stdlib/core.mjs +28 -0
- package/dist/stdlib/data-text.mjs +54 -0
- package/dist/stdlib/data.mjs +601 -0
- package/dist/stdlib/devtools.mjs +565 -0
- package/dist/stdlib/diff.mjs +180 -0
- package/dist/stdlib/fn.mjs +164 -0
- package/dist/stdlib/hierarchy.mjs +189 -0
- package/dist/stdlib/identifier.mjs +33 -0
- package/dist/stdlib/interop/js.mjs +706 -0
- package/dist/stdlib/interop/object.mjs +40 -0
- package/dist/stdlib/json.mjs +843 -0
- package/dist/stdlib/lazy-sequence.mjs +117 -0
- package/dist/stdlib/math.mjs +386 -0
- package/dist/stdlib/meta.mjs +21 -0
- package/dist/stdlib/multimethod.mjs +345 -0
- package/dist/stdlib/numeric.mjs +327 -0
- package/dist/stdlib/order.mjs +194 -0
- package/dist/stdlib/persistent-list.mjs +171 -0
- package/dist/stdlib/persistent-map.mjs +781 -0
- package/dist/stdlib/persistent-queue.mjs +44 -0
- package/dist/stdlib/persistent-set.mjs +225 -0
- package/dist/stdlib/persistent-vector.mjs +316 -0
- package/dist/stdlib/portable/data-text.mjs +1094 -0
- package/dist/stdlib/portable/data.mjs +62 -0
- package/dist/stdlib/portable/identifier.mjs +179 -0
- package/dist/stdlib/portable/metadata.mjs +63 -0
- package/dist/stdlib/portable/object.mjs +140 -0
- package/dist/stdlib/portable/sequence.mjs +142 -0
- package/dist/stdlib/portable/text.mjs +111 -0
- package/dist/stdlib/pprint.mjs +807 -0
- package/dist/stdlib/protocol.mjs +61 -0
- package/dist/stdlib/record.mjs +25 -0
- package/dist/stdlib/regex.mjs +115 -0
- package/dist/stdlib/result.mjs +198 -0
- package/dist/stdlib/schema.mjs +2828 -0
- package/dist/stdlib/seq.mjs +913 -0
- package/dist/stdlib/set.mjs +317 -0
- package/dist/stdlib/sorted.mjs +56 -0
- package/dist/stdlib/state.mjs +451 -0
- package/dist/stdlib/string.mjs +494 -0
- package/dist/stdlib/tap.mjs +187 -0
- package/dist/stdlib/test.mjs +669 -0
- package/dist/stdlib/time.mjs +522 -0
- package/dist/stdlib/transducer.mjs +85 -0
- package/dist/stdlib/transient.mjs +32 -0
- package/dist/stdlib/type.mjs +28 -0
- package/dist/stdlib/uuid.mjs +377 -0
- package/dist/stdlib/value.mjs +334 -0
- package/dist/stdlib/walk.mjs +243 -0
- package/dist/stdlib/wire/gepo.mjs +28 -0
- package/dist/stdlib/wire/mdp.mjs +13 -0
- package/dist/stdlib/wire/mds.mjs +10 -0
- package/dist/stdlib/zipper.mjs +1025 -0
- package/editor/README.md +15 -0
- package/editor/eliscript-data.el +221 -8
- package/editor/eliscript-mode.el +207 -48
- package/editor/eliscript-runtime.el +6 -3
- package/package.json +49 -15
- package/platform/README.md +6 -0
- package/platform/browser.mjs +10 -12
- package/platform/browser.mjs.map +1 -1
- package/runtime/README.md +12 -5
- package/runtime/core/array-map.eli +538 -0
- package/runtime/core/array-map.mjs +651 -0
- package/runtime/core/array-map.mjs.map +1 -0
- package/runtime/core/collection-internals.eli +85 -33
- package/runtime/core/collection-internals.mjs +245 -193
- package/runtime/core/collection-internals.mjs.map +1 -1
- package/runtime/core/collection.eli +105 -3
- package/runtime/core/collection.mjs +190 -53
- package/runtime/core/collection.mjs.map +1 -1
- package/runtime/core/data-text.eli +224 -16
- package/runtime/core/data-text.mjs +345 -83
- package/runtime/core/data-text.mjs.map +1 -1
- package/runtime/core/data.eli +50 -33
- package/runtime/core/data.mjs +72 -36
- package/runtime/core/data.mjs.map +1 -1
- package/runtime/core/identifier.mjs +15 -19
- package/runtime/core/identifier.mjs.map +1 -1
- package/runtime/core/lazy-sequence.eli +885 -15
- package/runtime/core/lazy-sequence.mjs +1265 -38
- package/runtime/core/lazy-sequence.mjs.map +1 -1
- package/runtime/core/map-internals.eli +209 -1
- package/runtime/core/map-internals.mjs +359 -71
- package/runtime/core/map-internals.mjs.map +1 -1
- package/runtime/core/map.eli +75 -7
- package/runtime/core/map.mjs +122 -47
- package/runtime/core/map.mjs.map +1 -1
- package/{stdlib/core/object.eli → runtime/core/object-impl.eli} +6 -6
- package/runtime/core/object-impl.mjs +5 -5
- package/runtime/core/object-impl.mjs.map +1 -1
- package/runtime/core/order.eli +15 -3
- package/runtime/core/order.mjs +23 -8
- package/runtime/core/order.mjs.map +1 -1
- package/runtime/core/persistent-kind.mjs +9 -13
- package/runtime/core/persistent-kind.mjs.map +1 -1
- package/runtime/core/protocol-error.mjs +9 -11
- package/runtime/core/protocol-error.mjs.map +1 -1
- package/{stdlib/core/protocol.eli → runtime/core/protocol-impl.eli} +2 -2
- package/runtime/core/protocol-impl.mjs +10 -10
- package/runtime/core/protocol-impl.mjs.map +1 -1
- package/runtime/core/queue.mjs +14 -16
- package/runtime/core/queue.mjs.map +1 -1
- package/runtime/core/record.eli +2 -2
- package/runtime/core/record.mjs +13 -17
- package/runtime/core/record.mjs.map +1 -1
- package/runtime/core/regex.mjs +18 -22
- package/runtime/core/regex.mjs.map +1 -1
- package/runtime/core/sequence.eli +33 -31
- package/runtime/core/sequence.mjs +60 -93
- package/runtime/core/sequence.mjs.map +1 -1
- package/runtime/core/set.eli +53 -27
- package/runtime/core/set.mjs +113 -82
- package/runtime/core/set.mjs.map +1 -1
- package/runtime/core/sorted.mjs +91 -108
- package/runtime/core/sorted.mjs.map +1 -1
- package/{stdlib/core/text.eli → runtime/core/text-impl.eli} +2 -2
- package/runtime/core/text-impl.mjs +1 -1
- package/runtime/core/text-impl.mjs.map +1 -1
- package/runtime/core/transducer.eli +24 -0
- package/runtime/core/transducer.mjs +27 -1
- package/runtime/core/transducer.mjs.map +1 -1
- package/runtime/core/transient-internals.eli +12 -4
- package/runtime/core/transient-internals.mjs +19 -6
- package/runtime/core/transient-internals.mjs.map +1 -1
- package/runtime/core/transient.eli +31 -0
- package/runtime/core/transient.mjs +33 -2
- package/runtime/core/transient.mjs.map +1 -1
- package/runtime/core/value-internals.mjs +29 -35
- package/runtime/core/value-internals.mjs.map +1 -1
- package/runtime/core/vector.eli +73 -20
- package/runtime/core/vector.mjs +159 -156
- package/runtime/core/vector.mjs.map +1 -1
- package/runtime/literals.eli +16 -9
- package/runtime/literals.mjs +25 -9
- package/runtime/literals.mjs.map +1 -1
- package/{stdlib → runtime/managed}/managed-literal-protocols.eli +100 -34
- package/{stdlib → runtime/managed}/managed-literals.eli +406 -81
- package/{dist/literal-sources/stdlib → runtime/managed}/managed-queue-state.eli +1 -1
- package/runtime/managed/managed-runtime-array-map.eli +45 -0
- package/{stdlib → runtime/managed}/managed-runtime-collection-internals.eli +22 -2
- package/{stdlib → runtime/managed}/managed-runtime-collection.eli +282 -23
- package/{stdlib → runtime/managed}/managed-runtime-data-text.eli +196 -13
- package/{stdlib → runtime/managed}/managed-runtime-data.eli +1 -1
- package/{stdlib → runtime/managed}/managed-runtime-identifier.eli +1 -1
- package/runtime/managed/managed-runtime-lazy-sequence.eli +935 -0
- package/{stdlib → runtime/managed}/managed-runtime-list.eli +1 -1
- package/{stdlib → runtime/managed}/managed-runtime-map.eli +1 -1
- package/{stdlib → runtime/managed}/managed-runtime-metadata-internals.eli +2 -2
- package/{stdlib → runtime/managed}/managed-runtime-metadata.eli +2 -2
- package/{stdlib → runtime/managed}/managed-runtime-object.eli +1 -1
- package/{stdlib → runtime/managed}/managed-runtime-order.eli +3 -3
- package/{stdlib → runtime/managed}/managed-runtime-persistent-kind.eli +1 -1
- package/{stdlib → runtime/managed}/managed-runtime-protocol.eli +5 -3
- package/{stdlib → runtime/managed}/managed-runtime-queue.eli +1 -1
- package/{stdlib → runtime/managed}/managed-runtime-record.eli +3 -3
- package/{stdlib → runtime/managed}/managed-runtime-regex.eli +2 -2
- package/{stdlib → runtime/managed}/managed-runtime-sequence.eli +1 -1
- package/{stdlib → runtime/managed}/managed-runtime-set-algebra.eli +1 -1
- package/{stdlib → runtime/managed}/managed-runtime-set.eli +1 -1
- package/{stdlib → runtime/managed}/managed-runtime-sorted.eli +4 -4
- package/{stdlib → runtime/managed}/managed-runtime-text.eli +1 -1
- package/{stdlib → runtime/managed}/managed-runtime-transducer.eli +24 -2
- package/{stdlib → runtime/managed}/managed-runtime-transient.eli +7 -5
- package/{stdlib → runtime/managed}/managed-runtime-type.eli +1 -1
- package/{stdlib → runtime/managed}/managed-runtime-value-internals.eli +3 -3
- package/{stdlib → runtime/managed}/managed-runtime-value.eli +2 -2
- package/{stdlib → runtime/managed}/managed-runtime-vector.eli +5 -2
- package/{dist/literal-sources/stdlib → runtime/managed}/managed-sorted-state.eli +1 -1
- package/runtime/managed/managed-transient-state.eli +1206 -0
- package/{dist/literal-sources/stdlib → runtime/managed}/managed-value-state.eli +30 -6
- package/{stdlib → runtime/managed}/managed-vector-view-state.eli +1 -1
- package/{stdlib → runtime/managed}/managed-wire-http-rpc.eli +1 -1
- package/{stdlib → runtime/managed}/managed-wire-markdown.eli +1 -1
- package/{stdlib → runtime/managed}/managed-wire-schema.eli +1 -1
- package/runtime/math.mjs +32 -38
- package/runtime/math.mjs.map +1 -1
- package/runtime/number-radix.mjs +5 -7
- package/runtime/number-radix.mjs.map +1 -1
- package/runtime/primitives.eli +19 -6
- package/runtime/primitives.mjs +81 -46
- package/runtime/primitives.mjs.map +1 -1
- package/runtime/source-mapping.mjs +17 -23
- package/runtime/source-mapping.mjs.map +1 -1
- package/runtime/testing/map.eli +70 -41
- package/runtime/testing/map.mjs +57 -34
- package/runtime/testing/map.mjs.map +1 -1
- package/runtime/unicode-case.mjs +6 -6
- package/runtime/unicode-case.mjs.map +1 -1
- package/runtime/wire/http-rpc.mjs +12 -18
- package/runtime/wire/http-rpc.mjs.map +1 -1
- package/runtime/wire/markdown.mjs +42 -42
- package/runtime/wire/markdown.mjs.map +1 -1
- package/runtime/wire/schema.mjs +13 -13
- package/runtime/wire/schema.mjs.map +1 -1
- package/runtime/worker-value-codec.mjs +5 -7
- package/runtime/worker-value-codec.mjs.map +1 -1
- package/runtime/worker-value-stream.mjs +128 -135
- package/runtime/worker-value-stream.mjs.map +1 -1
- package/runtime/worker.mjs +75 -89
- package/runtime/worker.mjs.map +1 -1
- package/stdlib/README.md +25 -18
- package/stdlib/async.eli +1245 -0
- package/stdlib/bit.eli +89 -1
- package/stdlib/bit.mjs +89 -2
- package/stdlib/bit.mjs.map +1 -1
- package/stdlib/{core/collection.eli → collection.eli} +39 -4
- package/stdlib/core.eli +956 -0
- package/stdlib/data-text.eli +62 -1091
- package/stdlib/data.eli +517 -37
- package/stdlib/devtools.eli +399 -0
- package/stdlib/diff.eli +134 -0
- package/stdlib/{function.eli → fn.eli} +1 -1
- package/stdlib/identifier.eli +21 -136
- package/stdlib/interop/object.eli +39 -0
- package/stdlib/{core/lazy-sequence.eli → lazy-sequence.eli} +28 -2
- package/stdlib/math.eli +267 -0
- package/stdlib/{core/metadata.eli → meta.eli} +2 -2
- package/stdlib/{core/order.eli → order.eli} +6 -6
- package/stdlib/persistent-list.eli +60 -21
- package/stdlib/persistent-map.eli +335 -324
- package/stdlib/persistent-set.eli +8 -6
- package/stdlib/persistent-vector.eli +18 -18
- package/stdlib/portable/data-text.eli +1092 -0
- package/stdlib/portable/data.eli +42 -0
- package/stdlib/portable/identifier.eli +147 -0
- package/stdlib/{metadata.eli → portable/metadata.eli} +5 -5
- package/stdlib/{object.eli → portable/object.eli} +1 -1
- package/stdlib/{sequence.eli → portable/sequence.eli} +1 -1
- package/stdlib/{text.eli → portable/text.eli} +1 -1
- package/stdlib/pprint.eli +588 -0
- package/stdlib/protocol.eli +63 -0
- package/stdlib/{core/record.eli → record.eli} +2 -2
- package/stdlib/regex.eli +70 -0
- package/stdlib/result.eli +53 -44
- package/stdlib/schema.eli +1886 -0
- package/stdlib/{core/seq.eli → seq.eli} +97 -90
- package/{dist/literal-sources/stdlib/core → stdlib}/set.eli +8 -8
- package/stdlib/{core/sorted.eli → sorted.eli} +2 -2
- package/stdlib/{state/atom.eli → state.eli} +137 -7
- package/stdlib/string.eli +362 -0
- package/stdlib/tap.eli +135 -0
- package/stdlib/test.eli +566 -0
- package/stdlib/time.eli +419 -0
- package/stdlib/{core/transducer.eli → transducer.eli} +4 -2
- package/stdlib/{core/transient.eli → transient.eli} +11 -5
- package/stdlib/{core/type.eli → type.eli} +2 -2
- package/stdlib/uuid.eli +288 -0
- package/stdlib/{core/walk.eli → walk.eli} +6 -6
- package/stdlib/{gepo.eli → wire/gepo.eli} +2 -2
- package/stdlib/{mdp.eli → wire/mdp.eli} +2 -2
- package/stdlib/{mds.eli → wire/mds.eli} +2 -2
- package/stdlib/{core/zipper.eli → zipper.eli} +179 -138
- package/tests/helpers/wasm-managed-math-node.mjs +495 -582
- package/tools/acceptance/check-ground.mjs +106 -132
- package/tools/acceptance/check.mjs +16 -16
- package/tools/acceptance/retained-performance-snapshot.mjs +265 -149
- package/tools/acceptance/retained-soak.mjs +5 -7
- package/tools/acceptance/retained-transient.mjs +5 -7
- package/tools/backends/build.mjs +373 -95
- package/tools/backends/compiler-bootstrap.mjs +271 -317
- package/tools/backends/compiler-browser.mjs +7 -9
- package/tools/backends/compiler-build.mjs +77 -97
- package/tools/backends/compiler-cli-ground.mjs +47 -47
- package/tools/backends/compiler-data-transport.mjs +27 -31
- package/tools/backends/compiler-host-iteration.mjs +13 -21
- package/tools/backends/compiler-host-record.mjs +28 -34
- package/tools/backends/compiler-metadata.mjs +145 -53
- package/tools/backends/compiler-package-ground.mjs +39 -47
- package/tools/backends/compiler-package-loader.mjs +164 -206
- package/tools/backends/compiler-session.mjs +432 -324
- package/tools/backends/compiler-worker.mjs +79 -89
- package/tools/backends/dist/bootstrap-js-stages.mjs +17 -19
- package/tools/backends/dist/bootstrap-js-stages.mjs.map +1 -1
- package/tools/backends/dist/managed-ir-inventory.mjs +1 -1
- package/tools/backends/dist/managed-ir-inventory.mjs.map +1 -1
- package/tools/backends/dist/release-cli.mjs +151 -22
- package/tools/backends/dist/release-cli.mjs.map +1 -1
- package/tools/backends/dist/run-artifact.mjs +54 -76
- package/tools/backends/dist/run-artifact.mjs.map +1 -1
- package/tools/backends/managed-foreign-binding.mjs +370 -114
- package/tools/backends/managed-host-ground.mjs +14 -17
- package/tools/backends/managed-host-lifecycle.mjs +42 -53
- package/tools/backends/managed-host-object-realm.mjs +121 -111
- package/tools/backends/managed-host-proxy.mjs +5 -7
- package/tools/backends/managed-host-runtime.mjs +6295 -4350
- package/tools/backends/managed-host.mjs +234 -188
- package/tools/backends/managed-layout.mjs +53 -56
- package/tools/backends/managed-module-graph-ground.mjs +488 -568
- package/tools/backends/managed-module-graph.mjs +62 -76
- package/tools/backends/managed-runtime-host-ground.mjs +352 -400
- package/tools/backends/managed-runtime.mjs +227 -266
- package/tools/backends/managed-source-view-ground.mjs +165 -161
- package/tools/backends/managed-source-view.mjs +415 -154
- package/tools/backends/native-managed-runtime.mjs +96 -138
- package/tools/backends/native-memory.mjs +1122 -742
- package/tools/backends/native-node-ffi.mjs +2439 -0
- package/tools/backends/native-node-memory.mjs +793 -383
- package/tools/backends/native-node-runner.mjs +1458 -579
- package/tools/backends/native-node-watchdog.mjs +12 -14
- package/tools/backends/native-node-worker.mjs +46 -50
- package/tools/backends/stage3-targets.mjs +2 -2
- package/tools/bootstrap-runtime.el +4 -4
- package/tools/collections/transient-builder-benchmark.mjs +17 -17
- package/tools/project/check-cli.eli +27 -3
- package/tools/project/project-cli.eli +1 -1
- package/tools/testing/maintained-suite-source.mjs +5 -7
- package/tools/testing/maintained-suite-source.mjs.map +1 -1
- package/dist/literal-sources/stdlib/core/data.eli +0 -306
- package/dist/literal-sources/stdlib/managed-transient-state.eli +0 -353
- package/stdlib/core/data-text.eli +0 -16
- package/stdlib/core/data.eli +0 -306
- package/stdlib/core/identifier.eli +0 -32
- package/stdlib/core/regex.eli +0 -17
- package/stdlib/deferred.eli +0 -70
- package/stdlib/managed-runtime-lazy-sequence.eli +0 -157
- package/stdlib/managed-transient-state.eli +0 -353
- /package/{stdlib → runtime/managed}/managed-protocol-error.eli +0 -0
- /package/{stdlib → runtime/managed}/managed-runtime-literals.eli +0 -0
- /package/{stdlib → runtime/managed}/managed-runtime-truth.eli +0 -0
- /package/{stdlib → runtime/managed}/managed-testing-value.eli +0 -0
|
@@ -363,130 +363,116 @@ function rt_make_gensym(session) {
|
|
|
363
363
|
});
|
|
364
364
|
}
|
|
365
365
|
function rt_catch(tag, thunk) {
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
return ((__eliscript_value_2) => { throw __eliscript_value_2; })(error);
|
|
374
|
-
}
|
|
366
|
+
try {
|
|
367
|
+
return thunk();
|
|
368
|
+
} catch (error) {
|
|
369
|
+
if ((!((error == null)) && __eliscript_truthy((error)["eliscriptThrow"]) && !(__eliscript_truthy((error)["clBlock"])) && ((error)["tag"] === tag))) {
|
|
370
|
+
return (error)["value"];
|
|
371
|
+
} else {
|
|
372
|
+
return ((__eliscript_value_2) => { throw __eliscript_value_2; })(error);
|
|
375
373
|
}
|
|
376
|
-
}
|
|
374
|
+
}
|
|
377
375
|
}
|
|
378
376
|
function rt_return_from(tag, value) {
|
|
379
377
|
return ((__eliscript_value_3) => { throw __eliscript_value_3; })(({"eliscriptThrow": true, "clBlock": true, "tag": tag, "value": value}));
|
|
380
378
|
}
|
|
381
379
|
function rt_condition_case(session, body_thunk, success_fn, handlers) {
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
return success_fn(value);
|
|
390
|
-
}
|
|
391
|
-
}
|
|
392
|
-
} catch (raw) {
|
|
393
|
-
if (__eliscript_truthy(el_control_transfer_QMARK_(raw))) {
|
|
394
|
-
((__eliscript_value_4) => { throw __eliscript_value_4; })(raw);
|
|
380
|
+
try {
|
|
381
|
+
{
|
|
382
|
+
let value = body_thunk();
|
|
383
|
+
if ((success_fn === null)) {
|
|
384
|
+
return value;
|
|
385
|
+
} else {
|
|
386
|
+
return success_fn(value);
|
|
395
387
|
}
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
388
|
+
}
|
|
389
|
+
} catch (raw) {
|
|
390
|
+
if (__eliscript_truthy(el_control_transfer_QMARK_(raw))) {
|
|
391
|
+
((__eliscript_value_4) => { throw __eliscript_value_4; })(raw);
|
|
392
|
+
}
|
|
393
|
+
{
|
|
394
|
+
let signal = el_error_from_host(raw);
|
|
395
|
+
let condition = (signal)["conditionSymbol"];
|
|
396
|
+
let matched = (handlers)["find"](((h) => {
|
|
397
|
+
return ((h)["conds"])["some"](((c) => {
|
|
398
|
+
return ((__eliscript_value_5) => (__eliscript_truthy(__eliscript_value_5) ? el_condition_matches(session, condition, c) : __eliscript_value_5))((c !== "debug"));
|
|
403
399
|
}));
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
}
|
|
407
|
-
return ((matched)["fn"])(el_cons(el_intern(condition), el_list_from((signal)["data"])));
|
|
400
|
+
}));
|
|
401
|
+
if ((matched === undefined)) {
|
|
402
|
+
((__eliscript_value_6) => { throw __eliscript_value_6; })(raw);
|
|
408
403
|
}
|
|
404
|
+
return ((matched)["fn"])(el_cons(el_intern(condition), el_list_from((signal)["data"])));
|
|
409
405
|
}
|
|
410
|
-
}
|
|
406
|
+
}
|
|
411
407
|
}
|
|
412
408
|
function rt_ignore_errors(session, thunk) {
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
return ((__eliscript_value_10) => { throw __eliscript_value_10; })(raw);
|
|
426
|
-
}
|
|
409
|
+
try {
|
|
410
|
+
return thunk();
|
|
411
|
+
} catch (raw) {
|
|
412
|
+
if (__eliscript_truthy(el_control_transfer_QMARK_(raw))) {
|
|
413
|
+
((__eliscript_value_7) => { throw __eliscript_value_7; })(raw);
|
|
414
|
+
}
|
|
415
|
+
{
|
|
416
|
+
let signal = el_error_from_host(raw);
|
|
417
|
+
if (__eliscript_truthy(el_condition_matches(session, (signal)["conditionSymbol"], "error"))) {
|
|
418
|
+
return null;
|
|
419
|
+
} else {
|
|
420
|
+
return ((__eliscript_value_8) => { throw __eliscript_value_8; })(raw);
|
|
427
421
|
}
|
|
428
422
|
}
|
|
429
|
-
}
|
|
423
|
+
}
|
|
430
424
|
}
|
|
431
425
|
function rt_ignore_error(session, conds, thunk) {
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
return ((__eliscript_value_12) => { throw __eliscript_value_12; })(raw);
|
|
447
|
-
}
|
|
426
|
+
try {
|
|
427
|
+
return thunk();
|
|
428
|
+
} catch (raw) {
|
|
429
|
+
if (__eliscript_truthy(el_control_transfer_QMARK_(raw))) {
|
|
430
|
+
((__eliscript_value_9) => { throw __eliscript_value_9; })(raw);
|
|
431
|
+
}
|
|
432
|
+
{
|
|
433
|
+
let signal = el_error_from_host(raw);
|
|
434
|
+
if (__eliscript_truthy((conds)["some"](((c) => {
|
|
435
|
+
return el_condition_matches(session, (signal)["conditionSymbol"], c);
|
|
436
|
+
})))) {
|
|
437
|
+
return null;
|
|
438
|
+
} else {
|
|
439
|
+
return ((__eliscript_value_10) => { throw __eliscript_value_10; })(raw);
|
|
448
440
|
}
|
|
449
441
|
}
|
|
450
|
-
}
|
|
442
|
+
}
|
|
451
443
|
}
|
|
452
444
|
function rt_save_match_data(session, thunk) {
|
|
453
445
|
{
|
|
454
446
|
let saved = (session)["matchData"];
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
}
|
|
461
|
-
})();
|
|
447
|
+
try {
|
|
448
|
+
return thunk();
|
|
449
|
+
} finally {
|
|
450
|
+
((session)["matchData"] = saved);
|
|
451
|
+
}
|
|
462
452
|
}
|
|
463
453
|
}
|
|
464
454
|
function rt_save_excursion(session, thunk) {
|
|
465
455
|
{
|
|
466
456
|
let buffer = el_current_buffer(session);
|
|
467
457
|
let point = (buffer)["point"];
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
}
|
|
475
|
-
})();
|
|
458
|
+
try {
|
|
459
|
+
return thunk();
|
|
460
|
+
} finally {
|
|
461
|
+
((session)["currentBuffer"] = buffer);
|
|
462
|
+
((buffer)["point"] = el_clamp_position(buffer, point));
|
|
463
|
+
}
|
|
476
464
|
}
|
|
477
465
|
}
|
|
478
466
|
function rt_save_current_buffer(session, thunk) {
|
|
479
467
|
{
|
|
480
468
|
let buffer = el_current_buffer(session);
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
((session)["currentBuffer"] = buffer);
|
|
487
|
-
}
|
|
469
|
+
try {
|
|
470
|
+
return thunk();
|
|
471
|
+
} finally {
|
|
472
|
+
if (__eliscript_truthy((buffer)["live"])) {
|
|
473
|
+
((session)["currentBuffer"] = buffer);
|
|
488
474
|
}
|
|
489
|
-
}
|
|
475
|
+
}
|
|
490
476
|
}
|
|
491
477
|
}
|
|
492
478
|
function rt_save_restriction(session, thunk) {
|
|
@@ -496,72 +482,66 @@ function rt_save_restriction(session, thunk) {
|
|
|
496
482
|
let saved_max = el_point_max(buffer);
|
|
497
483
|
let was_narrowed = (__eliscript_numeric_relation(">", saved_min, 1) || (!((buffer)["narrowMax"] === null)));
|
|
498
484
|
let tail_offset = __eliscript_numeric_sub(((((buffer)["text"]) ?? []).length + 1), saved_max);
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
if (__eliscript_truthy(
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
((buffer)["point"] = el_clamp_position(buffer, (buffer)["point"]));
|
|
510
|
-
}
|
|
511
|
-
} else {
|
|
512
|
-
((buffer)["narrowMin"] = 1);
|
|
513
|
-
((buffer)["narrowMax"] = null);
|
|
485
|
+
try {
|
|
486
|
+
return thunk();
|
|
487
|
+
} finally {
|
|
488
|
+
if (__eliscript_truthy((buffer)["live"])) {
|
|
489
|
+
if (__eliscript_truthy(was_narrowed)) {
|
|
490
|
+
{
|
|
491
|
+
let len = (((buffer)["text"]) ?? []).length;
|
|
492
|
+
((buffer)["narrowMin"] = Math.max(1, Math.min(saved_min, (len + 1))));
|
|
493
|
+
((buffer)["narrowMax"] = Math.max((buffer)["narrowMin"], __eliscript_numeric_sub((len + 1), tail_offset)));
|
|
494
|
+
((buffer)["point"] = el_clamp_position(buffer, (buffer)["point"]));
|
|
514
495
|
}
|
|
496
|
+
} else {
|
|
497
|
+
((buffer)["narrowMin"] = 1);
|
|
498
|
+
((buffer)["narrowMax"] = null);
|
|
515
499
|
}
|
|
516
500
|
}
|
|
517
|
-
}
|
|
501
|
+
}
|
|
518
502
|
}
|
|
519
503
|
}
|
|
520
504
|
function rt_with_demoted_errors(session, fmt_val, thunk) {
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
return null;
|
|
544
|
-
}
|
|
545
|
-
} else {
|
|
546
|
-
return ((__eliscript_value_14) => { throw __eliscript_value_14; })(raw);
|
|
505
|
+
try {
|
|
506
|
+
return thunk();
|
|
507
|
+
} catch (raw) {
|
|
508
|
+
if (__eliscript_truthy(el_control_transfer_QMARK_(raw))) {
|
|
509
|
+
((__eliscript_value_11) => { throw __eliscript_value_11; })(raw);
|
|
510
|
+
}
|
|
511
|
+
{
|
|
512
|
+
let signal = el_error_from_host(raw);
|
|
513
|
+
let condition = (signal)["conditionSymbol"];
|
|
514
|
+
if (__eliscript_truthy(el_condition_matches(session, condition, "error"))) {
|
|
515
|
+
{
|
|
516
|
+
let err_val = el_cons(el_intern(condition), el_list_from((signal)["data"]));
|
|
517
|
+
let fmt_str = (__eliscript_truthy(el_string_QMARK_(fmt_val)) ? fmt_val : "Error: %S");
|
|
518
|
+
let text = (() => {
|
|
519
|
+
try {
|
|
520
|
+
return el_format(session, fmt_str, [err_val]);
|
|
521
|
+
} catch (_) {
|
|
522
|
+
return (String(fmt_str) + String(" ") + String(el_prin1_string(err_val, true)));
|
|
523
|
+
}
|
|
524
|
+
})();
|
|
525
|
+
el_emit_output(session, (String(text) + String("\n")), true);
|
|
526
|
+
return null;
|
|
547
527
|
}
|
|
528
|
+
} else {
|
|
529
|
+
return ((__eliscript_value_12) => { throw __eliscript_value_12; })(raw);
|
|
548
530
|
}
|
|
549
531
|
}
|
|
550
|
-
}
|
|
532
|
+
}
|
|
551
533
|
}
|
|
552
534
|
function rt_with_temp_buffer(session, thunk) {
|
|
553
535
|
{
|
|
554
536
|
let previous = (session)["currentBuffer"];
|
|
555
537
|
let buffer = el_generate_new_buffer(session, " *temp*");
|
|
556
538
|
((session)["currentBuffer"] = buffer);
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
}
|
|
564
|
-
})();
|
|
539
|
+
try {
|
|
540
|
+
return thunk();
|
|
541
|
+
} finally {
|
|
542
|
+
el_kill_buffer(session, buffer);
|
|
543
|
+
((session)["currentBuffer"] = previous);
|
|
544
|
+
}
|
|
565
545
|
}
|
|
566
546
|
}
|
|
567
547
|
function rt_with_temp_file(session, file, thunk) {
|
|
@@ -569,18 +549,16 @@ function rt_with_temp_file(session, file, thunk) {
|
|
|
569
549
|
let previous = (session)["currentBuffer"];
|
|
570
550
|
let buffer = el_generate_new_buffer(session, " *temp file*");
|
|
571
551
|
((session)["currentBuffer"] = buffer);
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
return res;
|
|
578
|
-
}
|
|
579
|
-
} finally {
|
|
580
|
-
el_kill_buffer(session, buffer);
|
|
581
|
-
((session)["currentBuffer"] = previous);
|
|
552
|
+
try {
|
|
553
|
+
{
|
|
554
|
+
let res = thunk();
|
|
555
|
+
el_call(session, el_intern("write-region"), [1, el_point_max(buffer), file, null, el_intern("silent")]);
|
|
556
|
+
return res;
|
|
582
557
|
}
|
|
583
|
-
}
|
|
558
|
+
} finally {
|
|
559
|
+
el_kill_buffer(session, buffer);
|
|
560
|
+
((session)["currentBuffer"] = previous);
|
|
561
|
+
}
|
|
584
562
|
}
|
|
585
563
|
}
|
|
586
564
|
function rt_with_timeout(session, seconds, timeout_thunk, body_thunk) {
|
|
@@ -589,19 +567,17 @@ function rt_with_timeout(session, seconds, timeout_thunk, body_thunk) {
|
|
|
589
567
|
let deadline = (__eliscript_numeric_div((globalThis.Date)["now"](), 1000) + sec);
|
|
590
568
|
let prev_deadline = (session)["timeoutDeadline"];
|
|
591
569
|
((session)["timeoutDeadline"] = ((!((prev_deadline == null)) && __eliscript_numeric_relation("<", prev_deadline, deadline)) ? prev_deadline : deadline));
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
return ((__eliscript_value_15) => { throw __eliscript_value_15; })(err);
|
|
600
|
-
}
|
|
601
|
-
} finally {
|
|
602
|
-
((session)["timeoutDeadline"] = prev_deadline);
|
|
570
|
+
try {
|
|
571
|
+
return body_thunk();
|
|
572
|
+
} catch (err) {
|
|
573
|
+
if ((!((err == null)) && __eliscript_truthy((err)["eliscriptTimeout"]) && ((err)["deadline"] === deadline))) {
|
|
574
|
+
return timeout_thunk();
|
|
575
|
+
} else {
|
|
576
|
+
return ((__eliscript_value_13) => { throw __eliscript_value_13; })(err);
|
|
603
577
|
}
|
|
604
|
-
}
|
|
578
|
+
} finally {
|
|
579
|
+
((session)["timeoutDeadline"] = prev_deadline);
|
|
580
|
+
}
|
|
605
581
|
}
|
|
606
582
|
}
|
|
607
583
|
function rt_with_current_buffer(session, designator, thunk) {
|
|
@@ -609,27 +585,23 @@ function rt_with_current_buffer(session, designator, thunk) {
|
|
|
609
585
|
let previous = (session)["currentBuffer"];
|
|
610
586
|
let buffer = (__eliscript_truthy(el_string_QMARK_(designator)) ? el_get_buffer_create(session, designator) : designator);
|
|
611
587
|
((session)["currentBuffer"] = buffer);
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
}
|
|
618
|
-
})();
|
|
588
|
+
try {
|
|
589
|
+
return thunk();
|
|
590
|
+
} finally {
|
|
591
|
+
((session)["currentBuffer"] = previous);
|
|
592
|
+
}
|
|
619
593
|
}
|
|
620
594
|
}
|
|
621
595
|
function rt_with_output_to_string(session, thunk) {
|
|
622
596
|
{
|
|
623
597
|
let saved = (session)["output"];
|
|
624
598
|
((session)["output"] = []);
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
}
|
|
632
|
-
})();
|
|
599
|
+
try {
|
|
600
|
+
thunk();
|
|
601
|
+
return __eliscript_at_direct((session)["output"], "join", "");
|
|
602
|
+
} finally {
|
|
603
|
+
((session)["output"] = saved);
|
|
604
|
+
}
|
|
633
605
|
}
|
|
634
606
|
}
|
|
635
607
|
function rt_with_eval_after_load(session, target, thunk) {
|
|
@@ -1357,12 +1329,12 @@ function rt_pcase_qpat(session, qpat, value, setter) {
|
|
|
1357
1329
|
return rt_pcase_match(session, el_car((qpat)["cdr"]), value, setter);
|
|
1358
1330
|
} else {
|
|
1359
1331
|
if (__eliscript_truthy(el_cons_QMARK_(qpat))) {
|
|
1360
|
-
return ((
|
|
1332
|
+
return ((__eliscript_value_14) => (__eliscript_truthy(__eliscript_value_14) ? ((__eliscript_value_15) => (__eliscript_truthy(__eliscript_value_15) ? rt_pcase_qpat(session, (qpat)["cdr"], (value)["cdr"], setter) : __eliscript_value_15))(rt_pcase_qpat(session, (qpat)["car"], (value)["car"], setter)) : __eliscript_value_14))(el_cons_QMARK_(value));
|
|
1361
1333
|
} else {
|
|
1362
1334
|
if (__eliscript_truthy(el_vector_QMARK_(qpat))) {
|
|
1363
|
-
return ((
|
|
1335
|
+
return ((__eliscript_value_16) => (__eliscript_truthy(__eliscript_value_16) ? ((__eliscript_value_17) => (__eliscript_truthy(__eliscript_value_17) ? ((qpat)["items"])["every"](((q, index) => {
|
|
1364
1336
|
return rt_pcase_qpat(session, q, ((value)["items"])[index], setter);
|
|
1365
|
-
})) :
|
|
1337
|
+
})) : __eliscript_value_17))(((((qpat)["items"]) ?? []).length === (((value)["items"]) ?? []).length)) : __eliscript_value_16))(el_vector_QMARK_(value));
|
|
1366
1338
|
} else {
|
|
1367
1339
|
return el_equal_p(qpat, value, 0);
|
|
1368
1340
|
}
|
|
@@ -1728,7 +1700,7 @@ function rt_defstruct(session, spec) {
|
|
|
1728
1700
|
}));
|
|
1729
1701
|
if ((!(predicate === null))) {
|
|
1730
1702
|
el_define_function(session, el_intern(predicate), ((x) => {
|
|
1731
|
-
return el_bool(((
|
|
1703
|
+
return el_bool(((__eliscript_value_18) => (__eliscript_truthy(__eliscript_value_18) ? __eliscript_value_18 : el_struct_instance_QMARK_(session, x, name)))(((!(x === null)) && ((x)["kind"] === "record") && (((x)["items"])[0] === type_symbol))));
|
|
1732
1704
|
}));
|
|
1733
1705
|
}
|
|
1734
1706
|
if ((!(copier === null))) {
|
|
@@ -1767,34 +1739,32 @@ function rt_ert_deftest(session, name, tags, expected, body_fn) {
|
|
|
1767
1739
|
}
|
|
1768
1740
|
function rt_should(val, expr_datum) {
|
|
1769
1741
|
if ((val === null)) {
|
|
1770
|
-
((
|
|
1742
|
+
((__eliscript_value_19) => { throw __eliscript_value_19; })(el_make_signal("ert-test-failed", [el_list(el_intern("should"), expr_datum)]));
|
|
1771
1743
|
}
|
|
1772
1744
|
return val;
|
|
1773
1745
|
}
|
|
1774
1746
|
function rt_should_not(val, expr_datum) {
|
|
1775
1747
|
if ((!(val === null))) {
|
|
1776
|
-
((
|
|
1748
|
+
((__eliscript_value_20) => { throw __eliscript_value_20; })(el_make_signal("ert-test-failed", [el_list(el_intern("should-not"), expr_datum), el_intern(":value"), val]));
|
|
1777
1749
|
}
|
|
1778
1750
|
return null;
|
|
1779
1751
|
}
|
|
1780
1752
|
function rt_should_error(session, thunk, expected_type, expr_datum) {
|
|
1781
1753
|
{
|
|
1782
1754
|
let caught = null;
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
((__eliscript_value_23) => { throw __eliscript_value_23; })(raw);
|
|
1789
|
-
}
|
|
1790
|
-
return ((caught = el_error_from_host(raw)));
|
|
1755
|
+
try {
|
|
1756
|
+
thunk();
|
|
1757
|
+
} catch (raw) {
|
|
1758
|
+
if (__eliscript_truthy(el_control_transfer_QMARK_(raw))) {
|
|
1759
|
+
((__eliscript_value_21) => { throw __eliscript_value_21; })(raw);
|
|
1791
1760
|
}
|
|
1792
|
-
|
|
1761
|
+
((caught = el_error_from_host(raw)));
|
|
1762
|
+
}
|
|
1793
1763
|
if ((caught === null)) {
|
|
1794
|
-
((
|
|
1764
|
+
((__eliscript_value_22) => { throw __eliscript_value_22; })(el_make_signal("ert-test-failed", [el_list(el_intern("should-error"), expr_datum)]));
|
|
1795
1765
|
}
|
|
1796
1766
|
if ((!__eliscript_truthy(el_condition_matches(session, (caught)["conditionSymbol"], expected_type)))) {
|
|
1797
|
-
((
|
|
1767
|
+
((__eliscript_value_23) => { throw __eliscript_value_23; })(el_make_signal("ert-test-failed", [el_list(el_intern("should-error"), expr_datum), el_intern(":condition"), el_cons(el_intern((caught)["conditionSymbol"]), el_list_from((caught)["data"]))]));
|
|
1798
1768
|
}
|
|
1799
1769
|
return el_cons(el_intern((caught)["conditionSymbol"]), el_list_from((caught)["data"]));
|
|
1800
1770
|
}
|
|
@@ -1886,74 +1856,66 @@ function rt_make_async_fn(session, name, arglist, inner_fn) {
|
|
|
1886
1856
|
{
|
|
1887
1857
|
let previous = (session)["inAsyncContext"];
|
|
1888
1858
|
((session)["inAsyncContext"] = true);
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
return el_future("fulfilled", el_normalize_result(value), null);
|
|
1897
|
-
}
|
|
1898
|
-
}
|
|
1899
|
-
} catch (error) {
|
|
1900
|
-
if (__eliscript_truthy(el_control_transfer_QMARK_(error))) {
|
|
1901
|
-
((__eliscript_value_26) => { throw __eliscript_value_26; })(error);
|
|
1859
|
+
try {
|
|
1860
|
+
{
|
|
1861
|
+
let value = inner_fn(args);
|
|
1862
|
+
if ((el_kind(value) === "future")) {
|
|
1863
|
+
return value;
|
|
1864
|
+
} else {
|
|
1865
|
+
return el_future("fulfilled", el_normalize_result(value), null);
|
|
1902
1866
|
}
|
|
1903
|
-
return el_future("rejected", null, error);
|
|
1904
|
-
} finally {
|
|
1905
|
-
((session)["inAsyncContext"] = previous);
|
|
1906
1867
|
}
|
|
1907
|
-
}
|
|
1868
|
+
} catch (error) {
|
|
1869
|
+
if (__eliscript_truthy(el_control_transfer_QMARK_(error))) {
|
|
1870
|
+
((__eliscript_value_24) => { throw __eliscript_value_24; })(error);
|
|
1871
|
+
}
|
|
1872
|
+
return el_future("rejected", null, error);
|
|
1873
|
+
} finally {
|
|
1874
|
+
((session)["inAsyncContext"] = previous);
|
|
1875
|
+
}
|
|
1908
1876
|
}
|
|
1909
1877
|
}));
|
|
1910
1878
|
}
|
|
1911
1879
|
function rt_with_async_scope(session, body_fn) {
|
|
1912
1880
|
{
|
|
1913
1881
|
let scope = ({"kind": "async-scope", "handles": []});
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
return null;
|
|
1925
|
-
}
|
|
1882
|
+
try {
|
|
1883
|
+
return body_fn(scope);
|
|
1884
|
+
} finally {
|
|
1885
|
+
((scope)["handles"])["forEach"](((handle) => {
|
|
1886
|
+
{
|
|
1887
|
+
let revoke = el_symbol_function(session, el_intern("engine-revoke!"));
|
|
1888
|
+
if ((!(revoke === null))) {
|
|
1889
|
+
return revoke(handle);
|
|
1890
|
+
} else {
|
|
1891
|
+
return null;
|
|
1926
1892
|
}
|
|
1927
|
-
}
|
|
1928
|
-
}
|
|
1929
|
-
}
|
|
1893
|
+
}
|
|
1894
|
+
}));
|
|
1895
|
+
}
|
|
1930
1896
|
}
|
|
1931
1897
|
}
|
|
1932
1898
|
function rt_with_abi_memory(session, pages, thunk) {
|
|
1933
1899
|
{
|
|
1934
1900
|
let previous = (session)["abiMemory"];
|
|
1935
1901
|
((session)["abiMemory"] = new (globalThis.ArrayBuffer)(__eliscript_numeric_mul(pages, 65536)));
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
}
|
|
1942
|
-
})();
|
|
1902
|
+
try {
|
|
1903
|
+
return thunk();
|
|
1904
|
+
} finally {
|
|
1905
|
+
((session)["abiMemory"] = previous);
|
|
1906
|
+
}
|
|
1943
1907
|
}
|
|
1944
1908
|
}
|
|
1945
1909
|
function rt_with_transient(source, body_fn) {
|
|
1946
1910
|
{
|
|
1947
|
-
let builder = ({"kind": "transient", "active": true, "items": (((
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
}
|
|
1956
|
-
})();
|
|
1911
|
+
let builder = ({"kind": "transient", "active": true, "items": (((__eliscript_value_25) => (__eliscript_truthy(__eliscript_value_25) ? __eliscript_value_25 : []))((source)["items"]))["slice"]()});
|
|
1912
|
+
try {
|
|
1913
|
+
body_fn(builder);
|
|
1914
|
+
((builder)["active"] = false);
|
|
1915
|
+
return el_make_pcoll("persistent-vector", (builder)["items"]);
|
|
1916
|
+
} finally {
|
|
1917
|
+
((builder)["active"] = false);
|
|
1918
|
+
}
|
|
1957
1919
|
}
|
|
1958
1920
|
}
|
|
1959
1921
|
function rt_delay(thunk) {
|
|
@@ -2137,7 +2099,7 @@ function ctx_bind_fn(ctx, is_const = null, force_dyn = null) {
|
|
|
2137
2099
|
}
|
|
2138
2100
|
}
|
|
2139
2101
|
function cenv_set_var(ctx, cenv, name, js_var, sym_expr, is_const, force_dyn = null) {
|
|
2140
|
-
((cenv)["vars"])["set"](name, ({"jsVar": js_var, "symExpr": sym_expr, "isConst": is_const, "isDynamic": ((
|
|
2102
|
+
((cenv)["vars"])["set"](name, ({"jsVar": js_var, "symExpr": sym_expr, "isConst": is_const, "isDynamic": ((__eliscript_value_26) => (__eliscript_truthy(__eliscript_value_26) ? __eliscript_value_26 : (ctx)["dynamicMode"]))(force_dyn)}));
|
|
2141
2103
|
if (__eliscript_truthy(is_const)) {
|
|
2142
2104
|
return ((cenv)["consts"])["add"](name);
|
|
2143
2105
|
} else {
|
|
@@ -2520,64 +2482,25 @@ function compile_let(ctx, cenv, bindings_form, body_list, sequential, is_const,
|
|
|
2520
2482
|
let next_cenv = make_cenv(cenv);
|
|
2521
2483
|
let prev_dyn_mode = (ctx)["dynamicMode"];
|
|
2522
2484
|
let bind_fn = ctx_bind_fn(ctx, is_const, force_dyn);
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
if ((sym === s_lexical_binding)) {
|
|
2541
|
-
{
|
|
2542
|
-
let ov = extract_lex_mode_override(val_form);
|
|
2543
|
-
if (!((ov === null))) {
|
|
2544
|
-
return ((ctx)["dynamicMode"] = (ov === "dynamic"));
|
|
2545
|
-
} else {
|
|
2546
|
-
return null;
|
|
2547
|
-
}
|
|
2548
|
-
}
|
|
2549
|
-
} else {
|
|
2550
|
-
return null;
|
|
2551
|
-
}
|
|
2552
|
-
}
|
|
2553
|
-
}));
|
|
2554
|
-
(steps)["push"](compile_list_body(ctx, next_cenv, body_list));
|
|
2555
|
-
return (String("(let (") + String(__eliscript_at_direct(decls, "join", " ")) + String(") ") + String("(try (progn ") + String(__eliscript_at_direct(steps, "join", " ")) + String(") ") + String("(finally (rt-restore-dyn session ") + String(dyn_var) + String("))))"));
|
|
2556
|
-
}
|
|
2557
|
-
} else {
|
|
2558
|
-
{
|
|
2559
|
-
let init_decls = [];
|
|
2560
|
-
let var_decls = [(String("(") + String(dyn_var) + String(" (js-array))"))];
|
|
2561
|
-
let bind_steps = [];
|
|
2562
|
-
let entries = [];
|
|
2563
|
-
(raw_bindings)["forEach"](((b) => {
|
|
2564
|
-
{
|
|
2565
|
-
let sym = (__eliscript_truthy(el_cons_QMARK_(b)) ? (b)["car"] : b);
|
|
2566
|
-
let val_form = (__eliscript_truthy(el_cons_QMARK_(b)) ? el_car((b)["cdr"]) : null);
|
|
2567
|
-
let init_var = ctx_gensym(ctx, "init");
|
|
2568
|
-
let js_var = ctx_gensym(ctx, "v");
|
|
2569
|
-
let sym_expr = ctx_sym(ctx, (sym)["name"]);
|
|
2570
|
-
(init_decls)["push"]((String("(") + String(init_var) + String(" ") + String(compile_expr(ctx, cenv, val_form)) + String(")")));
|
|
2571
|
-
(var_decls)["push"]((String("(") + String(js_var) + String(" nil)")));
|
|
2572
|
-
(bind_steps)["push"]((String("(setq ") + String(js_var) + String(" (") + String(bind_fn) + String(" session ") + String(sym_expr) + String(" ") + String(init_var) + String(" ") + String(dyn_var) + String("))")));
|
|
2573
|
-
return (entries)["push"](({"sym": sym, "valForm": val_form, "name": (sym)["name"], "jsVar": js_var, "symExpr": sym_expr}));
|
|
2574
|
-
}
|
|
2575
|
-
}));
|
|
2576
|
-
(entries)["forEach"](((e) => {
|
|
2577
|
-
cenv_set_var(ctx, next_cenv, (e)["name"], (e)["jsVar"], (e)["symExpr"], is_const, force_dyn);
|
|
2578
|
-
if (((e)["sym"] === s_lexical_binding)) {
|
|
2485
|
+
try {
|
|
2486
|
+
if (__eliscript_truthy(sequential)) {
|
|
2487
|
+
{
|
|
2488
|
+
let decls = [(String("(") + String(dyn_var) + String(" (js-array))"))];
|
|
2489
|
+
let steps = [];
|
|
2490
|
+
(raw_bindings)["forEach"](((b) => {
|
|
2491
|
+
{
|
|
2492
|
+
let sym = (__eliscript_truthy(el_cons_QMARK_(b)) ? (b)["car"] : b);
|
|
2493
|
+
let val_form = (__eliscript_truthy(el_cons_QMARK_(b)) ? el_car((b)["cdr"]) : null);
|
|
2494
|
+
let val_expr = compile_expr(ctx, next_cenv, val_form);
|
|
2495
|
+
let js_var = ctx_gensym(ctx, "v");
|
|
2496
|
+
let sym_expr = ctx_sym(ctx, (sym)["name"]);
|
|
2497
|
+
let cur_bind_fn = ctx_bind_fn(ctx, is_const, force_dyn);
|
|
2498
|
+
(decls)["push"]((String("(") + String(js_var) + String(" nil)")));
|
|
2499
|
+
(steps)["push"]((String("(setq ") + String(js_var) + String(" (") + String(cur_bind_fn) + String(" session ") + String(sym_expr) + String(" ") + String(val_expr) + String(" ") + String(dyn_var) + String("))")));
|
|
2500
|
+
cenv_set_var(ctx, next_cenv, (sym)["name"], js_var, sym_expr, is_const, force_dyn);
|
|
2501
|
+
if ((sym === s_lexical_binding)) {
|
|
2579
2502
|
{
|
|
2580
|
-
let ov = extract_lex_mode_override(
|
|
2503
|
+
let ov = extract_lex_mode_override(val_form);
|
|
2581
2504
|
if (!((ov === null))) {
|
|
2582
2505
|
return ((ctx)["dynamicMode"] = (ov === "dynamic"));
|
|
2583
2506
|
} else {
|
|
@@ -2587,15 +2510,52 @@ function compile_let(ctx, cenv, bindings_form, body_list, sequential, is_const,
|
|
|
2587
2510
|
} else {
|
|
2588
2511
|
return null;
|
|
2589
2512
|
}
|
|
2590
|
-
}
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
|
|
2513
|
+
}
|
|
2514
|
+
}));
|
|
2515
|
+
(steps)["push"](compile_list_body(ctx, next_cenv, body_list));
|
|
2516
|
+
return (String("(let (") + String(__eliscript_at_direct(decls, "join", " ")) + String(") ") + String("(try (progn ") + String(__eliscript_at_direct(steps, "join", " ")) + String(") ") + String("(finally (rt-restore-dyn session ") + String(dyn_var) + String("))))"));
|
|
2517
|
+
}
|
|
2518
|
+
} else {
|
|
2519
|
+
{
|
|
2520
|
+
let init_decls = [];
|
|
2521
|
+
let var_decls = [(String("(") + String(dyn_var) + String(" (js-array))"))];
|
|
2522
|
+
let bind_steps = [];
|
|
2523
|
+
let entries = [];
|
|
2524
|
+
(raw_bindings)["forEach"](((b) => {
|
|
2525
|
+
{
|
|
2526
|
+
let sym = (__eliscript_truthy(el_cons_QMARK_(b)) ? (b)["car"] : b);
|
|
2527
|
+
let val_form = (__eliscript_truthy(el_cons_QMARK_(b)) ? el_car((b)["cdr"]) : null);
|
|
2528
|
+
let init_var = ctx_gensym(ctx, "init");
|
|
2529
|
+
let js_var = ctx_gensym(ctx, "v");
|
|
2530
|
+
let sym_expr = ctx_sym(ctx, (sym)["name"]);
|
|
2531
|
+
(init_decls)["push"]((String("(") + String(init_var) + String(" ") + String(compile_expr(ctx, cenv, val_form)) + String(")")));
|
|
2532
|
+
(var_decls)["push"]((String("(") + String(js_var) + String(" nil)")));
|
|
2533
|
+
(bind_steps)["push"]((String("(setq ") + String(js_var) + String(" (") + String(bind_fn) + String(" session ") + String(sym_expr) + String(" ") + String(init_var) + String(" ") + String(dyn_var) + String("))")));
|
|
2534
|
+
return (entries)["push"](({"sym": sym, "valForm": val_form, "name": (sym)["name"], "jsVar": js_var, "symExpr": sym_expr}));
|
|
2535
|
+
}
|
|
2536
|
+
}));
|
|
2537
|
+
(entries)["forEach"](((e) => {
|
|
2538
|
+
cenv_set_var(ctx, next_cenv, (e)["name"], (e)["jsVar"], (e)["symExpr"], is_const, force_dyn);
|
|
2539
|
+
if (((e)["sym"] === s_lexical_binding)) {
|
|
2540
|
+
{
|
|
2541
|
+
let ov = extract_lex_mode_override((e)["valForm"]);
|
|
2542
|
+
if (!((ov === null))) {
|
|
2543
|
+
return ((ctx)["dynamicMode"] = (ov === "dynamic"));
|
|
2544
|
+
} else {
|
|
2545
|
+
return null;
|
|
2546
|
+
}
|
|
2547
|
+
}
|
|
2548
|
+
} else {
|
|
2549
|
+
return null;
|
|
2550
|
+
}
|
|
2551
|
+
}));
|
|
2552
|
+
(bind_steps)["push"](compile_list_body(ctx, next_cenv, body_list));
|
|
2553
|
+
return (String("(let (") + String(__eliscript_at_direct((init_decls)["concat"](var_decls), "join", " ")) + String(") ") + String("(try (progn ") + String(__eliscript_at_direct(bind_steps, "join", " ")) + String(") ") + String("(finally (rt-restore-dyn session ") + String(dyn_var) + String("))))"));
|
|
2594
2554
|
}
|
|
2595
|
-
} finally {
|
|
2596
|
-
((ctx)["dynamicMode"] = prev_dyn_mode);
|
|
2597
2555
|
}
|
|
2598
|
-
}
|
|
2556
|
+
} finally {
|
|
2557
|
+
((ctx)["dynamicMode"] = prev_dyn_mode);
|
|
2558
|
+
}
|
|
2599
2559
|
}
|
|
2600
2560
|
}
|
|
2601
2561
|
}
|
|
@@ -3119,7 +3079,7 @@ function compile_cl_letf(ctx, cenv, form) {
|
|
|
3119
3079
|
{
|
|
3120
3080
|
let name = (place_form)["name"];
|
|
3121
3081
|
let sym_expr = ctx_sym(ctx, name);
|
|
3122
|
-
let was_lex = ((
|
|
3082
|
+
let was_lex = ((__eliscript_value_27) => (__eliscript_truthy(__eliscript_value_27) ? (!__eliscript_truthy((((eval_cenv)["vars"])["get"](name))["isDynamic"])) : __eliscript_value_27))(((eval_cenv)["vars"])["has"](name));
|
|
3123
3083
|
let val_expr = compile_expr(ctx, eval_cenv, val_form);
|
|
3124
3084
|
let js_var = ctx_gensym(ctx, "v");
|
|
3125
3085
|
(decls)["push"]((String("(") + String(js_var) + String(" nil)")));
|
|
@@ -3588,7 +3548,7 @@ function compile_cl_loop(ctx, cenv, form) {
|
|
|
3588
3548
|
(keyword_is = ((name) => {
|
|
3589
3549
|
{
|
|
3590
3550
|
let token = peek();
|
|
3591
|
-
return ((
|
|
3551
|
+
return ((__eliscript_value_28) => (__eliscript_truthy(__eliscript_value_28) ? el_sym_is(token, name) : __eliscript_value_28))((!(token === undefined)));
|
|
3592
3552
|
}
|
|
3593
3553
|
}));
|
|
3594
3554
|
(forms_until_keyword = (() => {
|
|
@@ -3954,13 +3914,11 @@ function compile_cl_defstruct(ctx, cenv, form) {
|
|
|
3954
3914
|
let copier = (String("copy-") + String(name));
|
|
3955
3915
|
let predicate = (String(name) + String("-p"));
|
|
3956
3916
|
let parent = null;
|
|
3957
|
-
|
|
3958
|
-
|
|
3959
|
-
|
|
3960
|
-
|
|
3961
|
-
|
|
3962
|
-
}
|
|
3963
|
-
})();
|
|
3917
|
+
try {
|
|
3918
|
+
el_eval(csession, form, el_root_env());
|
|
3919
|
+
} catch (_) {
|
|
3920
|
+
null;
|
|
3921
|
+
}
|
|
3964
3922
|
(options)["forEach"](((option) => {
|
|
3965
3923
|
{
|
|
3966
3924
|
let key = el_symbol_name((__eliscript_truthy(el_cons_QMARK_(option)) ? (option)["car"] : option));
|
|
@@ -4524,7 +4482,7 @@ function compile_condition_case(ctx, cenv, form) {
|
|
|
4524
4482
|
let raw_handlers = el_list_to_array(el_rest_after(form, 2));
|
|
4525
4483
|
let bind_fn = ctx_bind_fn(ctx, false, false);
|
|
4526
4484
|
let success_clause = (raw_handlers)["find"](((h) => {
|
|
4527
|
-
return ((
|
|
4485
|
+
return ((__eliscript_value_29) => (__eliscript_truthy(__eliscript_value_29) ? el_sym_is((h)["car"], ":success") : __eliscript_value_29))(el_cons_QMARK_(h));
|
|
4528
4486
|
}));
|
|
4529
4487
|
let err_clauses = (raw_handlers)["filter"](((h) => {
|
|
4530
4488
|
return (!(__eliscript_truthy(el_cons_QMARK_(h)) && __eliscript_truthy(el_sym_is((h)["car"], ":success"))));
|
|
@@ -4683,7 +4641,7 @@ function compile_defmodule(ctx, cenv, form) {
|
|
|
4683
4641
|
}
|
|
4684
4642
|
}
|
|
4685
4643
|
function ext_active_QMARK_(csession, lib_name, sym_name) {
|
|
4686
|
-
return ((
|
|
4644
|
+
return ((__eliscript_value_30) => (__eliscript_truthy(__eliscript_value_30) ? (!__eliscript_truthy(((csession)["userDefinedFns"])["has"](sym_name))) : __eliscript_value_30))(((csession)["activeLibs"])["has"](lib_name));
|
|
4687
4645
|
}
|
|
4688
4646
|
function compile_expr(ctx, cenv, form) {
|
|
4689
4647
|
{
|
|
@@ -4779,13 +4737,11 @@ function compile_expr(ctx, cenv, form) {
|
|
|
4779
4737
|
} else {
|
|
4780
4738
|
if (((name === "progn") || (name === "eval-and-compile") || (name === "with-no-warnings") || (name === "inline") || (name === "with-local-quit") || (name === "with-syntax-table") || (name === "combine-after-change-calls") || (name === "with-silent-modifications") || (name === "save-mark-and-excursion"))) {
|
|
4781
4739
|
if ((name === "eval-and-compile")) {
|
|
4782
|
-
|
|
4783
|
-
|
|
4784
|
-
|
|
4785
|
-
|
|
4786
|
-
|
|
4787
|
-
}
|
|
4788
|
-
})();
|
|
4740
|
+
try {
|
|
4741
|
+
el_eval_body(csession, el_list_to_array((form)["cdr"]), el_root_env());
|
|
4742
|
+
} catch (_) {
|
|
4743
|
+
null;
|
|
4744
|
+
}
|
|
4789
4745
|
}
|
|
4790
4746
|
return compile_list_body(ctx, cenv, (form)["cdr"]);
|
|
4791
4747
|
} else {
|
|
@@ -5041,13 +4997,11 @@ function compile_expr(ctx, cenv, form) {
|
|
|
5041
4997
|
let sym = el_second(form);
|
|
5042
4998
|
let val_form = el_third(form);
|
|
5043
4999
|
el_add_special_var(csession, sym);
|
|
5044
|
-
|
|
5045
|
-
|
|
5046
|
-
|
|
5047
|
-
|
|
5048
|
-
|
|
5049
|
-
}
|
|
5050
|
-
})();
|
|
5000
|
+
try {
|
|
5001
|
+
((csession)["values"])["set"](sym, el_eval(csession, val_form, el_root_env()));
|
|
5002
|
+
} catch (_) {
|
|
5003
|
+
null;
|
|
5004
|
+
}
|
|
5051
5005
|
return (String("(rt-defconst session ") + String(ctx_sym(ctx, (sym)["name"])) + String(" ") + String(compile_expr(ctx, cenv, val_form)) + String(")"));
|
|
5052
5006
|
}
|
|
5053
5007
|
} else {
|
|
@@ -5073,13 +5027,11 @@ function compile_expr(ctx, cenv, form) {
|
|
|
5073
5027
|
ctx_record_fn(ctx, fn_name);
|
|
5074
5028
|
((csession)["userDefinedFns"])["add"](fn_name);
|
|
5075
5029
|
((csession)["macros"])["delete"](fn_sym);
|
|
5076
|
-
|
|
5077
|
-
|
|
5078
|
-
|
|
5079
|
-
|
|
5080
|
-
|
|
5081
|
-
}
|
|
5082
|
-
})();
|
|
5030
|
+
try {
|
|
5031
|
+
el_eval(csession, form, el_root_env());
|
|
5032
|
+
} catch (_) {
|
|
5033
|
+
null;
|
|
5034
|
+
}
|
|
5083
5035
|
return (String("(rt-defun session ") + String(ctx_sym(ctx, fn_name)) + String(" ") + String(compile_quote(ctx, el_car(rest))) + String(" (get ") + String(compile_lambda_impl(ctx, cenv, rest, fn_name, false, null)) + String(" :elispCall))"));
|
|
5084
5036
|
}
|
|
5085
5037
|
} else {
|
|
@@ -5091,13 +5043,11 @@ function compile_expr(ctx, cenv, form) {
|
|
|
5091
5043
|
ctx_record_fn(ctx, fn_name);
|
|
5092
5044
|
((csession)["userDefinedFns"])["add"](fn_name);
|
|
5093
5045
|
((csession)["macros"])["delete"](fn_sym);
|
|
5094
|
-
|
|
5095
|
-
|
|
5096
|
-
|
|
5097
|
-
|
|
5098
|
-
|
|
5099
|
-
}
|
|
5100
|
-
})();
|
|
5046
|
+
try {
|
|
5047
|
+
el_eval(csession, form, el_root_env());
|
|
5048
|
+
} catch (_) {
|
|
5049
|
+
null;
|
|
5050
|
+
}
|
|
5101
5051
|
return (String("(rt-defun session ") + String(ctx_sym(ctx, fn_name)) + String(" ") + String(compile_quote(ctx, el_car(rest))) + String(" (get ") + String(compile_lambda_impl(ctx, cenv, rest, fn_name, true, fn_name)) + String(" :elispCall))"));
|
|
5102
5052
|
}
|
|
5103
5053
|
} else {
|
|
@@ -5489,23 +5439,19 @@ function compile_expr(ctx, cenv, form) {
|
|
|
5489
5439
|
return (String("(rt-define-minor-mode session ") + String(compile_quote(ctx, el_second(form))) + String(")"));
|
|
5490
5440
|
} else {
|
|
5491
5441
|
if ((name === "gv-define-simple-setter")) {
|
|
5492
|
-
|
|
5493
|
-
|
|
5494
|
-
|
|
5495
|
-
|
|
5496
|
-
|
|
5497
|
-
}
|
|
5498
|
-
})();
|
|
5442
|
+
try {
|
|
5443
|
+
el_eval(csession, form, el_root_env());
|
|
5444
|
+
} catch (_) {
|
|
5445
|
+
null;
|
|
5446
|
+
}
|
|
5499
5447
|
return (String("(rt-gv-define-simple-setter session ") + String(compile_quote(ctx, el_second(form))) + String(" ") + String(compile_quote(ctx, el_third(form))) + String(")"));
|
|
5500
5448
|
} else {
|
|
5501
5449
|
if ((name === "gv-define-setter")) {
|
|
5502
|
-
|
|
5503
|
-
|
|
5504
|
-
|
|
5505
|
-
|
|
5506
|
-
|
|
5507
|
-
}
|
|
5508
|
-
})();
|
|
5450
|
+
try {
|
|
5451
|
+
el_eval(csession, form, el_root_env());
|
|
5452
|
+
} catch (_) {
|
|
5453
|
+
null;
|
|
5454
|
+
}
|
|
5509
5455
|
{
|
|
5510
5456
|
let g_name = el_symbol_name(el_second(form));
|
|
5511
5457
|
let arglist = el_third(form);
|
|
@@ -6226,13 +6172,11 @@ function rt_true_source_file(filename) {
|
|
|
6226
6172
|
{
|
|
6227
6173
|
let fs_mod = el_fs();
|
|
6228
6174
|
if ((__eliscript_truthy(el_string_QMARK_(filename)) && !((fs_mod == null)) && !(((fs_mod)["realpathSync"] == null)))) {
|
|
6229
|
-
|
|
6230
|
-
|
|
6231
|
-
|
|
6232
|
-
|
|
6233
|
-
|
|
6234
|
-
}
|
|
6235
|
-
})();
|
|
6175
|
+
try {
|
|
6176
|
+
return (fs_mod)["realpathSync"](filename);
|
|
6177
|
+
} catch (_err) {
|
|
6178
|
+
return filename;
|
|
6179
|
+
}
|
|
6236
6180
|
} else {
|
|
6237
6181
|
return filename;
|
|
6238
6182
|
}
|
|
@@ -6247,68 +6191,64 @@ function rt_with_source_file(session, filename, thunk, lex_mode = null) {
|
|
|
6247
6191
|
if (!((stack == null))) {
|
|
6248
6192
|
(stack)["push"](pending_features);
|
|
6249
6193
|
}
|
|
6250
|
-
|
|
6251
|
-
|
|
6252
|
-
{
|
|
6253
|
-
|
|
6254
|
-
|
|
6255
|
-
|
|
6256
|
-
|
|
6257
|
-
rt_bind_dyn(session, el_intern("load-true-file-name"), truename, dyn);
|
|
6258
|
-
}
|
|
6259
|
-
rt_bind_dyn(session, s_lexical_binding, ((lex_mode === undefined) ? true : lex_mode), dyn);
|
|
6260
|
-
return thunk();
|
|
6261
|
-
} finally {
|
|
6262
|
-
rt_restore_dyn(session, dyn);
|
|
6263
|
-
}
|
|
6264
|
-
})();
|
|
6265
|
-
if (!((stack == null))) {
|
|
6266
|
-
(stack)["pop"]();
|
|
6267
|
-
}
|
|
6268
|
-
{
|
|
6269
|
-
let i = 0;
|
|
6270
|
-
while (__eliscript_numeric_relation("<", i, ((pending_features) ?? []).length)) {
|
|
6271
|
-
el_fire_after_load(session, (pending_features)[i]);
|
|
6272
|
-
((i = (i + 1)));
|
|
6194
|
+
try {
|
|
6195
|
+
{
|
|
6196
|
+
let result = (() => {
|
|
6197
|
+
try {
|
|
6198
|
+
if (__eliscript_truthy(el_string_QMARK_(filename))) {
|
|
6199
|
+
rt_bind_dyn(session, el_intern("load-file-name"), filename, dyn);
|
|
6200
|
+
rt_bind_dyn(session, el_intern("load-true-file-name"), truename, dyn);
|
|
6273
6201
|
}
|
|
6202
|
+
rt_bind_dyn(session, s_lexical_binding, ((lex_mode === undefined) ? true : lex_mode), dyn);
|
|
6203
|
+
return thunk();
|
|
6204
|
+
} finally {
|
|
6205
|
+
rt_restore_dyn(session, dyn);
|
|
6274
6206
|
}
|
|
6275
|
-
|
|
6276
|
-
|
|
6277
|
-
} catch (err) {
|
|
6278
|
-
if ((!((stack == null)) && __eliscript_numeric_relation(">", ((stack) ?? []).length, 0) && ((stack)[__eliscript_numeric_decrement(((stack) ?? []).length)] === pending_features))) {
|
|
6207
|
+
})();
|
|
6208
|
+
if (!((stack == null))) {
|
|
6279
6209
|
(stack)["pop"]();
|
|
6280
6210
|
}
|
|
6281
|
-
|
|
6211
|
+
{
|
|
6212
|
+
let i = 0;
|
|
6213
|
+
while (__eliscript_numeric_relation("<", i, ((pending_features) ?? []).length)) {
|
|
6214
|
+
el_fire_after_load(session, (pending_features)[i]);
|
|
6215
|
+
((i = (i + 1)));
|
|
6216
|
+
}
|
|
6217
|
+
}
|
|
6218
|
+
return result;
|
|
6219
|
+
}
|
|
6220
|
+
} catch (err) {
|
|
6221
|
+
if ((!((stack == null)) && __eliscript_numeric_relation(">", ((stack) ?? []).length, 0) && ((stack)[__eliscript_numeric_decrement(((stack) ?? []).length)] === pending_features))) {
|
|
6222
|
+
(stack)["pop"]();
|
|
6282
6223
|
}
|
|
6283
|
-
|
|
6224
|
+
return ((__eliscript_value_31) => { throw __eliscript_value_31; })(err);
|
|
6225
|
+
}
|
|
6284
6226
|
}
|
|
6285
6227
|
}
|
|
6286
6228
|
function rt_autorun_module(session, load_fn) {
|
|
6287
6229
|
{
|
|
6288
6230
|
let p = globalThis.process;
|
|
6289
|
-
|
|
6290
|
-
|
|
6291
|
-
|
|
6292
|
-
|
|
6293
|
-
|
|
6294
|
-
|
|
6295
|
-
let status = (!(((err)["code"] == null)) ? (err)["code"] : (err)["status"]);
|
|
6296
|
-
if ((!((p == null)) && !(((p)["exit"] == null)))) {
|
|
6297
|
-
return (p)["exit"]((__eliscript_truthy(el_integer_QMARK_(status)) ? status : 0));
|
|
6298
|
-
} else {
|
|
6299
|
-
return null;
|
|
6300
|
-
}
|
|
6301
|
-
}
|
|
6302
|
-
} else {
|
|
6303
|
-
el_write_stderr((String("Error: ") + String(((!((err == null)) && !(((err)["conditionSymbol"] == null))) ? el_signal_message(session, err) : ((!((err == null)) && !(((err)["message"] == null))) ? (err)["message"] : (String(err)))))));
|
|
6231
|
+
try {
|
|
6232
|
+
return load_fn(session);
|
|
6233
|
+
} catch (err) {
|
|
6234
|
+
if ((!((err == null)) && (__eliscript_truthy((err)["eliscriptBatchExit"]) || __eliscript_truthy((err)["eliscriptKillEmacs"])))) {
|
|
6235
|
+
{
|
|
6236
|
+
let status = (!(((err)["code"] == null)) ? (err)["code"] : (err)["status"]);
|
|
6304
6237
|
if ((!((p == null)) && !(((p)["exit"] == null)))) {
|
|
6305
|
-
return (p)["exit"](
|
|
6238
|
+
return (p)["exit"]((__eliscript_truthy(el_integer_QMARK_(status)) ? status : 0));
|
|
6306
6239
|
} else {
|
|
6307
|
-
return
|
|
6240
|
+
return null;
|
|
6308
6241
|
}
|
|
6309
6242
|
}
|
|
6243
|
+
} else {
|
|
6244
|
+
el_write_stderr((String("Error: ") + String(((!((err == null)) && !(((err)["conditionSymbol"] == null))) ? el_signal_message(session, err) : ((!((err == null)) && !(((err)["message"] == null))) ? (err)["message"] : (String(err)))))));
|
|
6245
|
+
if ((!((p == null)) && !(((p)["exit"] == null)))) {
|
|
6246
|
+
return (p)["exit"](255);
|
|
6247
|
+
} else {
|
|
6248
|
+
return ((__eliscript_value_32) => { throw __eliscript_value_32; })(err);
|
|
6249
|
+
}
|
|
6310
6250
|
}
|
|
6311
|
-
}
|
|
6251
|
+
}
|
|
6312
6252
|
}
|
|
6313
6253
|
}
|
|
6314
6254
|
function compileModule(source, options = null) {
|
|
@@ -6316,10 +6256,10 @@ function compileModule(source, options = null) {
|
|
|
6316
6256
|
let module_name = (((options == null) || ((options)["moduleName"] == null)) ? "eliscript.generated.elisp-module" : (options)["moduleName"]);
|
|
6317
6257
|
let runtime = (((options == null) || ((options)["runtime"] == null)) ? "eliscript/runtime/lisp" : (options)["runtime"]);
|
|
6318
6258
|
let source_file = (((options == null) || ((options)["sourceFile"] == null)) ? null : (options)["sourceFile"]);
|
|
6319
|
-
let autorun = ((
|
|
6259
|
+
let autorun = ((__eliscript_value_33) => (__eliscript_truthy(__eliscript_value_33) ? (options)["autorun"] : __eliscript_value_33))((!(options == null)));
|
|
6320
6260
|
let csession = ((!((options == null)) && !(((options)["session"] == null))) ? (options)["session"] : createSession());
|
|
6321
6261
|
{
|
|
6322
|
-
let has_file = ((
|
|
6262
|
+
let has_file = ((__eliscript_value_34) => (__eliscript_truthy(__eliscript_value_34) ? __eliscript_numeric_relation(">", ((source_file) ?? []).length, 0) : __eliscript_value_34))(el_string_QMARK_(source_file));
|
|
6323
6263
|
let lex_mode = el_source_lexical_binding(source, source_file, true);
|
|
6324
6264
|
if (__eliscript_truthy(has_file)) {
|
|
6325
6265
|
el_set_dynamic_variable(csession, el_intern("load-file-name"), source_file);
|