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.
Files changed (526) hide show
  1. package/COPYING.RUNTIME +93 -0
  2. package/README.md +15 -3
  3. package/bin/eliscript-test +29 -0
  4. package/bootstrap/backends/README.md +5 -4
  5. package/bootstrap/backends/binary.eli +89 -22
  6. package/bootstrap/backends/capabilities.eli +9 -4
  7. package/bootstrap/backends/managed-layout.eli +93 -81
  8. package/bootstrap/backends/managed.eli +651 -125
  9. package/bootstrap/backends/native.eli +1791 -324
  10. package/bootstrap/backends/numeric.eli +71 -7
  11. package/bootstrap/backends/sha256.eli +165 -68
  12. package/bootstrap/backends/wasm.eli +461 -52
  13. package/bootstrap/compiler/analyzer.eli +692 -2
  14. package/bootstrap/compiler/compiler.eli +16 -3
  15. package/bootstrap/compiler/emitter.eli +80 -35
  16. package/bootstrap/compiler/project.eli +175 -1
  17. package/bootstrap/compiler/transient-analysis.eli +2 -2
  18. package/bootstrap/host/build.eli +1 -0
  19. package/bootstrap/host/build.mjs +1 -1
  20. package/bootstrap/host/build.mjs.map +1 -1
  21. package/bootstrap/host/bun.mjs +7 -9
  22. package/bootstrap/host/bun.mjs.map +1 -1
  23. package/bootstrap/host/check-cli-ground.eli +47 -5
  24. package/bootstrap/host/check-cli-ground.mjs +60 -19
  25. package/bootstrap/host/check-cli-ground.mjs.map +1 -1
  26. package/bootstrap/host/check-cli.mjs +41 -1
  27. package/bootstrap/host/check-cli.mjs.map +1 -1
  28. package/bootstrap/host/compiler-session.eli +136 -22
  29. package/bootstrap/host/eliscript-cli.mjs +1 -1
  30. package/bootstrap/host/eliscript-cli.mjs.map +1 -1
  31. package/bootstrap/host/evaluation-cli.eli +33 -1
  32. package/bootstrap/host/evaluation-cli.mjs +65 -28
  33. package/bootstrap/host/evaluation-cli.mjs.map +1 -1
  34. package/bootstrap/host/evaluation.eli +651 -42
  35. package/bootstrap/host/evaluation.mjs +884 -72
  36. package/bootstrap/host/evaluation.mjs.map +1 -1
  37. package/bootstrap/host/project-cli-ground.eli +6 -1
  38. package/bootstrap/host/project-cli-ground.mjs +33 -32
  39. package/bootstrap/host/project-cli-ground.mjs.map +1 -1
  40. package/bootstrap/host/project-cli.mjs +1 -1
  41. package/bootstrap/host/project-cli.mjs.map +1 -1
  42. package/bootstrap/host/project-ground.eli +266 -45
  43. package/bootstrap/host/project-ground.mjs +429 -159
  44. package/bootstrap/host/project-ground.mjs.map +1 -1
  45. package/bootstrap/host/project.mjs +30 -40
  46. package/bootstrap/host/project.mjs.map +1 -1
  47. package/bootstrap/host/test-cli.eli +379 -0
  48. package/bootstrap/host/test-cli.mjs +494 -0
  49. package/bootstrap/host/test-cli.mjs.map +1 -0
  50. package/browser/README.md +7 -0
  51. package/browser/host.mjs +21 -29
  52. package/browser/host.mjs.map +1 -1
  53. package/browser/worker.mjs +7 -9
  54. package/browser/worker.mjs.map +1 -1
  55. package/compiler/eliscript-analyzer.el +694 -0
  56. package/compiler/eliscript-cli.el +66 -22
  57. package/compiler/eliscript-emitter.el +67 -43
  58. package/compiler/eliscript-ir-emitter.el +71 -36
  59. package/compiler/eliscript-project.el +360 -80
  60. package/compiler/eliscript-transient-analysis.el +5 -5
  61. package/compiler/eliscript.el +6 -0
  62. package/dist/backends/binary.mjs +148 -26
  63. package/dist/backends/binary.mjs.map +1 -1
  64. package/dist/backends/capabilities.mjs +11 -4
  65. package/dist/backends/capabilities.mjs.map +1 -1
  66. package/dist/backends/elf.mjs +4 -4
  67. package/dist/backends/elf.mjs.map +1 -1
  68. package/dist/backends/managed-layout.mjs +53 -56
  69. package/dist/backends/managed-layout.mjs.map +1 -1
  70. package/dist/backends/managed.mjs +1116 -375
  71. package/dist/backends/managed.mjs.map +1 -1
  72. package/dist/backends/memory.mjs +24 -26
  73. package/dist/backends/memory.mjs.map +1 -1
  74. package/dist/backends/native.mjs +2529 -434
  75. package/dist/backends/native.mjs.map +1 -1
  76. package/dist/backends/numeric.mjs +140 -33
  77. package/dist/backends/numeric.mjs.map +1 -1
  78. package/dist/backends/optimize.mjs +2 -2
  79. package/dist/backends/optimize.mjs.map +1 -1
  80. package/dist/backends/regexp.mjs +33 -35
  81. package/dist/backends/regexp.mjs.map +1 -1
  82. package/dist/backends/sha256.mjs +159 -59
  83. package/dist/backends/sha256.mjs.map +1 -1
  84. package/dist/backends/wasm.mjs +609 -73
  85. package/dist/backends/wasm.mjs.map +1 -1
  86. package/dist/bootstrap/analyzer.mjs +1018 -2
  87. package/dist/bootstrap/analyzer.mjs.map +1 -1
  88. package/dist/bootstrap/compiler.mjs +30 -23
  89. package/dist/bootstrap/compiler.mjs.map +1 -1
  90. package/dist/bootstrap/emitter.mjs +206 -161
  91. package/dist/bootstrap/emitter.mjs.macro-origins.json +16 -16
  92. package/dist/bootstrap/emitter.mjs.map +1 -1
  93. package/dist/bootstrap/expander.mjs +27 -31
  94. package/dist/bootstrap/expander.mjs.map +1 -1
  95. package/dist/bootstrap/ir.mjs +22 -24
  96. package/dist/bootstrap/ir.mjs.map +1 -1
  97. package/dist/bootstrap/project.mjs +246 -1
  98. package/dist/bootstrap/project.mjs.map +1 -1
  99. package/dist/bootstrap/reader.mjs +2 -2
  100. package/dist/bootstrap/reader.mjs.map +1 -1
  101. package/dist/bootstrap/source-map.mjs +34 -48
  102. package/dist/bootstrap/source-map.mjs.map +1 -1
  103. package/dist/bootstrap/transient-analysis.mjs +2 -2
  104. package/dist/bootstrap/transient-analysis.mjs.map +1 -1
  105. package/dist/browser/compiler.js +106 -106
  106. package/dist/browser/host.mjs +21 -29
  107. package/dist/browser/loader.js +1 -1
  108. package/dist/browser/worker.mjs +95 -95
  109. package/dist/compiler-artifact.json +1 -1
  110. package/dist/host/compiler-session.mjs +405 -228
  111. package/dist/host/compiler-session.mjs.map +1 -1
  112. package/dist/host/compiler-tools.mjs +44 -46
  113. package/dist/host/compiler-tools.mjs.map +1 -1
  114. package/dist/literal-sources/runtime/core/array-map.eli +45 -0
  115. package/dist/literal-sources/runtime/core/collection-internals.eli +22 -2
  116. package/dist/literal-sources/runtime/core/collection.eli +282 -23
  117. package/dist/literal-sources/runtime/core/data-text.eli +196 -13
  118. package/dist/literal-sources/runtime/core/data.eli +1 -1
  119. package/dist/literal-sources/runtime/core/identifier.eli +1 -1
  120. package/dist/literal-sources/runtime/core/lazy-sequence.eli +822 -44
  121. package/dist/literal-sources/runtime/core/list.eli +1 -1
  122. package/dist/literal-sources/runtime/core/map.eli +1 -1
  123. package/dist/literal-sources/runtime/core/metadata-internals.eli +2 -2
  124. package/dist/literal-sources/runtime/core/metadata.eli +2 -2
  125. package/dist/literal-sources/{stdlib/core/object.eli → runtime/core/object-impl.eli} +6 -6
  126. package/dist/literal-sources/runtime/core/object.eli +1 -1
  127. package/dist/literal-sources/runtime/core/order.eli +3 -3
  128. package/dist/literal-sources/runtime/core/persistent-kind.eli +1 -1
  129. package/dist/literal-sources/{stdlib/core/protocol.eli → runtime/core/protocol-impl.eli} +2 -2
  130. package/dist/literal-sources/runtime/core/protocol.eli +5 -3
  131. package/dist/literal-sources/runtime/core/queue.eli +1 -1
  132. package/dist/literal-sources/runtime/core/record.eli +3 -3
  133. package/dist/literal-sources/runtime/core/regex.eli +2 -2
  134. package/dist/literal-sources/runtime/core/sequence.eli +1 -1
  135. package/dist/literal-sources/runtime/core/set-algebra.eli +1 -1
  136. package/dist/literal-sources/runtime/core/set.eli +1 -1
  137. package/dist/literal-sources/runtime/core/sorted.eli +4 -4
  138. package/dist/literal-sources/{stdlib/core/text.eli → runtime/core/text-impl.eli} +2 -2
  139. package/dist/literal-sources/runtime/core/text.eli +1 -1
  140. package/dist/literal-sources/runtime/core/transducer.eli +24 -2
  141. package/dist/literal-sources/runtime/core/transient.eli +7 -5
  142. package/dist/literal-sources/runtime/core/type.eli +1 -1
  143. package/dist/literal-sources/runtime/core/value-internals.eli +3 -3
  144. package/dist/literal-sources/runtime/core/value.eli +2 -2
  145. package/dist/literal-sources/runtime/core/vector.eli +5 -2
  146. package/dist/literal-sources/{stdlib → runtime/managed}/managed-literal-protocols.eli +100 -34
  147. package/dist/literal-sources/{stdlib → runtime/managed}/managed-literals.eli +406 -81
  148. package/{stdlib → dist/literal-sources/runtime/managed}/managed-queue-state.eli +1 -1
  149. package/{stdlib → dist/literal-sources/runtime/managed}/managed-sorted-state.eli +1 -1
  150. package/dist/literal-sources/runtime/managed/managed-transient-state.eli +1206 -0
  151. package/{stdlib → dist/literal-sources/runtime/managed}/managed-value-state.eli +30 -6
  152. package/dist/literal-sources/{stdlib → runtime/managed}/managed-vector-view-state.eli +1 -1
  153. package/dist/literal-sources/runtime/wire/http-rpc.eli +1 -1
  154. package/dist/literal-sources/runtime/wire/markdown.eli +1 -1
  155. package/dist/literal-sources/runtime/wire/schema.eli +1 -1
  156. package/dist/literal-sources/stdlib/bit.eli +89 -1
  157. package/dist/literal-sources/stdlib/data.eli +522 -0
  158. package/dist/literal-sources/stdlib/interop/object.eli +39 -0
  159. package/dist/literal-sources/stdlib/persistent-list.eli +60 -21
  160. package/dist/literal-sources/stdlib/persistent-map.eli +335 -324
  161. package/dist/literal-sources/stdlib/persistent-set.eli +8 -6
  162. package/dist/literal-sources/stdlib/persistent-vector.eli +18 -18
  163. package/dist/literal-sources/stdlib/protocol.eli +63 -0
  164. package/{stdlib/core → dist/literal-sources/stdlib}/set.eli +8 -8
  165. package/dist/literal-sources/stdlib/string.eli +362 -0
  166. package/dist/runtime/lisp/async-runtime.mjs +55 -59
  167. package/dist/runtime/lisp/async-runtime.mjs.map +1 -1
  168. package/dist/runtime/lisp/builtins.mjs +232 -280
  169. package/dist/runtime/lisp/builtins.mjs.map +1 -1
  170. package/dist/runtime/lisp/cli.mjs +159 -167
  171. package/dist/runtime/lisp/cli.mjs.map +1 -1
  172. package/dist/runtime/lisp/compiler.mjs +359 -419
  173. package/dist/runtime/lisp/compiler.mjs.map +1 -1
  174. package/dist/runtime/lisp/core.mjs +24 -24
  175. package/dist/runtime/lisp/core.mjs.map +1 -1
  176. package/dist/runtime/lisp/evaluator.mjs +315 -385
  177. package/dist/runtime/lisp/evaluator.mjs.map +1 -1
  178. package/dist/runtime/lisp/extensions.mjs +85 -103
  179. package/dist/runtime/lisp/extensions.mjs.map +1 -1
  180. package/dist/runtime/lisp/host-io.mjs +106 -122
  181. package/dist/runtime/lisp/host-io.mjs.map +1 -1
  182. package/dist/runtime/lisp/io-worker.mjs +117 -135
  183. package/dist/runtime/lisp/io-worker.mjs.map +1 -1
  184. package/dist/runtime/lisp/keymap.mjs +5 -5
  185. package/dist/runtime/lisp/keymap.mjs.map +1 -1
  186. package/dist/runtime/lisp/macros-forms.mjs +49 -51
  187. package/dist/runtime/lisp/macros-forms.mjs.map +1 -1
  188. package/dist/runtime/lisp/reader-format.mjs +31 -31
  189. package/dist/runtime/lisp/reader-format.mjs.map +1 -1
  190. package/dist/runtime/lisp/regexp-buffer.mjs +9 -9
  191. package/dist/runtime/lisp/regexp-buffer.mjs.map +1 -1
  192. package/dist/runtime/math.mjs +32 -38
  193. package/dist/runtime/math.mjs.map +1 -1
  194. package/dist/runtime/number-radix.mjs +5 -7
  195. package/dist/runtime/number-radix.mjs.map +1 -1
  196. package/dist/runtime/primitives.mjs +81 -46
  197. package/dist/runtime/primitives.mjs.macro-origins.json +294 -44
  198. package/dist/runtime/primitives.mjs.map +1 -1
  199. package/dist/runtime/unicode-case.mjs +6 -6
  200. package/dist/runtime/unicode-case.mjs.map +1 -1
  201. package/dist/runtime.eli +3068 -1882
  202. package/dist/stage3-release.json +1 -1
  203. package/dist/stdlib/async.mjs +1838 -0
  204. package/dist/stdlib/bit.mjs +116 -0
  205. package/dist/stdlib/collection.mjs +193 -0
  206. package/dist/stdlib/core.mjs +28 -0
  207. package/dist/stdlib/data-text.mjs +54 -0
  208. package/dist/stdlib/data.mjs +601 -0
  209. package/dist/stdlib/devtools.mjs +565 -0
  210. package/dist/stdlib/diff.mjs +180 -0
  211. package/dist/stdlib/fn.mjs +164 -0
  212. package/dist/stdlib/hierarchy.mjs +189 -0
  213. package/dist/stdlib/identifier.mjs +33 -0
  214. package/dist/stdlib/interop/js.mjs +706 -0
  215. package/dist/stdlib/interop/object.mjs +40 -0
  216. package/dist/stdlib/json.mjs +843 -0
  217. package/dist/stdlib/lazy-sequence.mjs +117 -0
  218. package/dist/stdlib/math.mjs +386 -0
  219. package/dist/stdlib/meta.mjs +21 -0
  220. package/dist/stdlib/multimethod.mjs +345 -0
  221. package/dist/stdlib/numeric.mjs +327 -0
  222. package/dist/stdlib/order.mjs +194 -0
  223. package/dist/stdlib/persistent-list.mjs +171 -0
  224. package/dist/stdlib/persistent-map.mjs +781 -0
  225. package/dist/stdlib/persistent-queue.mjs +44 -0
  226. package/dist/stdlib/persistent-set.mjs +225 -0
  227. package/dist/stdlib/persistent-vector.mjs +316 -0
  228. package/dist/stdlib/portable/data-text.mjs +1094 -0
  229. package/dist/stdlib/portable/data.mjs +62 -0
  230. package/dist/stdlib/portable/identifier.mjs +179 -0
  231. package/dist/stdlib/portable/metadata.mjs +63 -0
  232. package/dist/stdlib/portable/object.mjs +140 -0
  233. package/dist/stdlib/portable/sequence.mjs +142 -0
  234. package/dist/stdlib/portable/text.mjs +111 -0
  235. package/dist/stdlib/pprint.mjs +807 -0
  236. package/dist/stdlib/protocol.mjs +61 -0
  237. package/dist/stdlib/record.mjs +25 -0
  238. package/dist/stdlib/regex.mjs +115 -0
  239. package/dist/stdlib/result.mjs +198 -0
  240. package/dist/stdlib/schema.mjs +2828 -0
  241. package/dist/stdlib/seq.mjs +913 -0
  242. package/dist/stdlib/set.mjs +317 -0
  243. package/dist/stdlib/sorted.mjs +56 -0
  244. package/dist/stdlib/state.mjs +451 -0
  245. package/dist/stdlib/string.mjs +494 -0
  246. package/dist/stdlib/tap.mjs +187 -0
  247. package/dist/stdlib/test.mjs +669 -0
  248. package/dist/stdlib/time.mjs +522 -0
  249. package/dist/stdlib/transducer.mjs +85 -0
  250. package/dist/stdlib/transient.mjs +32 -0
  251. package/dist/stdlib/type.mjs +28 -0
  252. package/dist/stdlib/uuid.mjs +377 -0
  253. package/dist/stdlib/value.mjs +334 -0
  254. package/dist/stdlib/walk.mjs +243 -0
  255. package/dist/stdlib/wire/gepo.mjs +28 -0
  256. package/dist/stdlib/wire/mdp.mjs +13 -0
  257. package/dist/stdlib/wire/mds.mjs +10 -0
  258. package/dist/stdlib/zipper.mjs +1025 -0
  259. package/editor/README.md +15 -0
  260. package/editor/eliscript-data.el +221 -8
  261. package/editor/eliscript-mode.el +207 -48
  262. package/editor/eliscript-runtime.el +6 -3
  263. package/package.json +49 -15
  264. package/platform/README.md +6 -0
  265. package/platform/browser.mjs +10 -12
  266. package/platform/browser.mjs.map +1 -1
  267. package/runtime/README.md +12 -5
  268. package/runtime/core/array-map.eli +538 -0
  269. package/runtime/core/array-map.mjs +651 -0
  270. package/runtime/core/array-map.mjs.map +1 -0
  271. package/runtime/core/collection-internals.eli +85 -33
  272. package/runtime/core/collection-internals.mjs +245 -193
  273. package/runtime/core/collection-internals.mjs.map +1 -1
  274. package/runtime/core/collection.eli +105 -3
  275. package/runtime/core/collection.mjs +190 -53
  276. package/runtime/core/collection.mjs.map +1 -1
  277. package/runtime/core/data-text.eli +224 -16
  278. package/runtime/core/data-text.mjs +345 -83
  279. package/runtime/core/data-text.mjs.map +1 -1
  280. package/runtime/core/data.eli +50 -33
  281. package/runtime/core/data.mjs +72 -36
  282. package/runtime/core/data.mjs.map +1 -1
  283. package/runtime/core/identifier.mjs +15 -19
  284. package/runtime/core/identifier.mjs.map +1 -1
  285. package/runtime/core/lazy-sequence.eli +885 -15
  286. package/runtime/core/lazy-sequence.mjs +1265 -38
  287. package/runtime/core/lazy-sequence.mjs.map +1 -1
  288. package/runtime/core/map-internals.eli +209 -1
  289. package/runtime/core/map-internals.mjs +359 -71
  290. package/runtime/core/map-internals.mjs.map +1 -1
  291. package/runtime/core/map.eli +75 -7
  292. package/runtime/core/map.mjs +122 -47
  293. package/runtime/core/map.mjs.map +1 -1
  294. package/{stdlib/core/object.eli → runtime/core/object-impl.eli} +6 -6
  295. package/runtime/core/object-impl.mjs +5 -5
  296. package/runtime/core/object-impl.mjs.map +1 -1
  297. package/runtime/core/order.eli +15 -3
  298. package/runtime/core/order.mjs +23 -8
  299. package/runtime/core/order.mjs.map +1 -1
  300. package/runtime/core/persistent-kind.mjs +9 -13
  301. package/runtime/core/persistent-kind.mjs.map +1 -1
  302. package/runtime/core/protocol-error.mjs +9 -11
  303. package/runtime/core/protocol-error.mjs.map +1 -1
  304. package/{stdlib/core/protocol.eli → runtime/core/protocol-impl.eli} +2 -2
  305. package/runtime/core/protocol-impl.mjs +10 -10
  306. package/runtime/core/protocol-impl.mjs.map +1 -1
  307. package/runtime/core/queue.mjs +14 -16
  308. package/runtime/core/queue.mjs.map +1 -1
  309. package/runtime/core/record.eli +2 -2
  310. package/runtime/core/record.mjs +13 -17
  311. package/runtime/core/record.mjs.map +1 -1
  312. package/runtime/core/regex.mjs +18 -22
  313. package/runtime/core/regex.mjs.map +1 -1
  314. package/runtime/core/sequence.eli +33 -31
  315. package/runtime/core/sequence.mjs +60 -93
  316. package/runtime/core/sequence.mjs.map +1 -1
  317. package/runtime/core/set.eli +53 -27
  318. package/runtime/core/set.mjs +113 -82
  319. package/runtime/core/set.mjs.map +1 -1
  320. package/runtime/core/sorted.mjs +91 -108
  321. package/runtime/core/sorted.mjs.map +1 -1
  322. package/{stdlib/core/text.eli → runtime/core/text-impl.eli} +2 -2
  323. package/runtime/core/text-impl.mjs +1 -1
  324. package/runtime/core/text-impl.mjs.map +1 -1
  325. package/runtime/core/transducer.eli +24 -0
  326. package/runtime/core/transducer.mjs +27 -1
  327. package/runtime/core/transducer.mjs.map +1 -1
  328. package/runtime/core/transient-internals.eli +12 -4
  329. package/runtime/core/transient-internals.mjs +19 -6
  330. package/runtime/core/transient-internals.mjs.map +1 -1
  331. package/runtime/core/transient.eli +31 -0
  332. package/runtime/core/transient.mjs +33 -2
  333. package/runtime/core/transient.mjs.map +1 -1
  334. package/runtime/core/value-internals.mjs +29 -35
  335. package/runtime/core/value-internals.mjs.map +1 -1
  336. package/runtime/core/vector.eli +73 -20
  337. package/runtime/core/vector.mjs +159 -156
  338. package/runtime/core/vector.mjs.map +1 -1
  339. package/runtime/literals.eli +16 -9
  340. package/runtime/literals.mjs +25 -9
  341. package/runtime/literals.mjs.map +1 -1
  342. package/{stdlib → runtime/managed}/managed-literal-protocols.eli +100 -34
  343. package/{stdlib → runtime/managed}/managed-literals.eli +406 -81
  344. package/{dist/literal-sources/stdlib → runtime/managed}/managed-queue-state.eli +1 -1
  345. package/runtime/managed/managed-runtime-array-map.eli +45 -0
  346. package/{stdlib → runtime/managed}/managed-runtime-collection-internals.eli +22 -2
  347. package/{stdlib → runtime/managed}/managed-runtime-collection.eli +282 -23
  348. package/{stdlib → runtime/managed}/managed-runtime-data-text.eli +196 -13
  349. package/{stdlib → runtime/managed}/managed-runtime-data.eli +1 -1
  350. package/{stdlib → runtime/managed}/managed-runtime-identifier.eli +1 -1
  351. package/runtime/managed/managed-runtime-lazy-sequence.eli +935 -0
  352. package/{stdlib → runtime/managed}/managed-runtime-list.eli +1 -1
  353. package/{stdlib → runtime/managed}/managed-runtime-map.eli +1 -1
  354. package/{stdlib → runtime/managed}/managed-runtime-metadata-internals.eli +2 -2
  355. package/{stdlib → runtime/managed}/managed-runtime-metadata.eli +2 -2
  356. package/{stdlib → runtime/managed}/managed-runtime-object.eli +1 -1
  357. package/{stdlib → runtime/managed}/managed-runtime-order.eli +3 -3
  358. package/{stdlib → runtime/managed}/managed-runtime-persistent-kind.eli +1 -1
  359. package/{stdlib → runtime/managed}/managed-runtime-protocol.eli +5 -3
  360. package/{stdlib → runtime/managed}/managed-runtime-queue.eli +1 -1
  361. package/{stdlib → runtime/managed}/managed-runtime-record.eli +3 -3
  362. package/{stdlib → runtime/managed}/managed-runtime-regex.eli +2 -2
  363. package/{stdlib → runtime/managed}/managed-runtime-sequence.eli +1 -1
  364. package/{stdlib → runtime/managed}/managed-runtime-set-algebra.eli +1 -1
  365. package/{stdlib → runtime/managed}/managed-runtime-set.eli +1 -1
  366. package/{stdlib → runtime/managed}/managed-runtime-sorted.eli +4 -4
  367. package/{stdlib → runtime/managed}/managed-runtime-text.eli +1 -1
  368. package/{stdlib → runtime/managed}/managed-runtime-transducer.eli +24 -2
  369. package/{stdlib → runtime/managed}/managed-runtime-transient.eli +7 -5
  370. package/{stdlib → runtime/managed}/managed-runtime-type.eli +1 -1
  371. package/{stdlib → runtime/managed}/managed-runtime-value-internals.eli +3 -3
  372. package/{stdlib → runtime/managed}/managed-runtime-value.eli +2 -2
  373. package/{stdlib → runtime/managed}/managed-runtime-vector.eli +5 -2
  374. package/{dist/literal-sources/stdlib → runtime/managed}/managed-sorted-state.eli +1 -1
  375. package/runtime/managed/managed-transient-state.eli +1206 -0
  376. package/{dist/literal-sources/stdlib → runtime/managed}/managed-value-state.eli +30 -6
  377. package/{stdlib → runtime/managed}/managed-vector-view-state.eli +1 -1
  378. package/{stdlib → runtime/managed}/managed-wire-http-rpc.eli +1 -1
  379. package/{stdlib → runtime/managed}/managed-wire-markdown.eli +1 -1
  380. package/{stdlib → runtime/managed}/managed-wire-schema.eli +1 -1
  381. package/runtime/math.mjs +32 -38
  382. package/runtime/math.mjs.map +1 -1
  383. package/runtime/number-radix.mjs +5 -7
  384. package/runtime/number-radix.mjs.map +1 -1
  385. package/runtime/primitives.eli +19 -6
  386. package/runtime/primitives.mjs +81 -46
  387. package/runtime/primitives.mjs.map +1 -1
  388. package/runtime/source-mapping.mjs +17 -23
  389. package/runtime/source-mapping.mjs.map +1 -1
  390. package/runtime/testing/map.eli +70 -41
  391. package/runtime/testing/map.mjs +57 -34
  392. package/runtime/testing/map.mjs.map +1 -1
  393. package/runtime/unicode-case.mjs +6 -6
  394. package/runtime/unicode-case.mjs.map +1 -1
  395. package/runtime/wire/http-rpc.mjs +12 -18
  396. package/runtime/wire/http-rpc.mjs.map +1 -1
  397. package/runtime/wire/markdown.mjs +42 -42
  398. package/runtime/wire/markdown.mjs.map +1 -1
  399. package/runtime/wire/schema.mjs +13 -13
  400. package/runtime/wire/schema.mjs.map +1 -1
  401. package/runtime/worker-value-codec.mjs +5 -7
  402. package/runtime/worker-value-codec.mjs.map +1 -1
  403. package/runtime/worker-value-stream.mjs +128 -135
  404. package/runtime/worker-value-stream.mjs.map +1 -1
  405. package/runtime/worker.mjs +75 -89
  406. package/runtime/worker.mjs.map +1 -1
  407. package/stdlib/README.md +25 -18
  408. package/stdlib/async.eli +1245 -0
  409. package/stdlib/bit.eli +89 -1
  410. package/stdlib/bit.mjs +89 -2
  411. package/stdlib/bit.mjs.map +1 -1
  412. package/stdlib/{core/collection.eli → collection.eli} +39 -4
  413. package/stdlib/core.eli +956 -0
  414. package/stdlib/data-text.eli +62 -1091
  415. package/stdlib/data.eli +517 -37
  416. package/stdlib/devtools.eli +399 -0
  417. package/stdlib/diff.eli +134 -0
  418. package/stdlib/{function.eli → fn.eli} +1 -1
  419. package/stdlib/identifier.eli +21 -136
  420. package/stdlib/interop/object.eli +39 -0
  421. package/stdlib/{core/lazy-sequence.eli → lazy-sequence.eli} +28 -2
  422. package/stdlib/math.eli +267 -0
  423. package/stdlib/{core/metadata.eli → meta.eli} +2 -2
  424. package/stdlib/{core/order.eli → order.eli} +6 -6
  425. package/stdlib/persistent-list.eli +60 -21
  426. package/stdlib/persistent-map.eli +335 -324
  427. package/stdlib/persistent-set.eli +8 -6
  428. package/stdlib/persistent-vector.eli +18 -18
  429. package/stdlib/portable/data-text.eli +1092 -0
  430. package/stdlib/portable/data.eli +42 -0
  431. package/stdlib/portable/identifier.eli +147 -0
  432. package/stdlib/{metadata.eli → portable/metadata.eli} +5 -5
  433. package/stdlib/{object.eli → portable/object.eli} +1 -1
  434. package/stdlib/{sequence.eli → portable/sequence.eli} +1 -1
  435. package/stdlib/{text.eli → portable/text.eli} +1 -1
  436. package/stdlib/pprint.eli +588 -0
  437. package/stdlib/protocol.eli +63 -0
  438. package/stdlib/{core/record.eli → record.eli} +2 -2
  439. package/stdlib/regex.eli +70 -0
  440. package/stdlib/result.eli +53 -44
  441. package/stdlib/schema.eli +1886 -0
  442. package/stdlib/{core/seq.eli → seq.eli} +97 -90
  443. package/{dist/literal-sources/stdlib/core → stdlib}/set.eli +8 -8
  444. package/stdlib/{core/sorted.eli → sorted.eli} +2 -2
  445. package/stdlib/{state/atom.eli → state.eli} +137 -7
  446. package/stdlib/string.eli +362 -0
  447. package/stdlib/tap.eli +135 -0
  448. package/stdlib/test.eli +566 -0
  449. package/stdlib/time.eli +419 -0
  450. package/stdlib/{core/transducer.eli → transducer.eli} +4 -2
  451. package/stdlib/{core/transient.eli → transient.eli} +11 -5
  452. package/stdlib/{core/type.eli → type.eli} +2 -2
  453. package/stdlib/uuid.eli +288 -0
  454. package/stdlib/{core/walk.eli → walk.eli} +6 -6
  455. package/stdlib/{gepo.eli → wire/gepo.eli} +2 -2
  456. package/stdlib/{mdp.eli → wire/mdp.eli} +2 -2
  457. package/stdlib/{mds.eli → wire/mds.eli} +2 -2
  458. package/stdlib/{core/zipper.eli → zipper.eli} +179 -138
  459. package/tests/helpers/wasm-managed-math-node.mjs +495 -582
  460. package/tools/acceptance/check-ground.mjs +106 -132
  461. package/tools/acceptance/check.mjs +16 -16
  462. package/tools/acceptance/retained-performance-snapshot.mjs +265 -149
  463. package/tools/acceptance/retained-soak.mjs +5 -7
  464. package/tools/acceptance/retained-transient.mjs +5 -7
  465. package/tools/backends/build.mjs +373 -95
  466. package/tools/backends/compiler-bootstrap.mjs +271 -317
  467. package/tools/backends/compiler-browser.mjs +7 -9
  468. package/tools/backends/compiler-build.mjs +77 -97
  469. package/tools/backends/compiler-cli-ground.mjs +47 -47
  470. package/tools/backends/compiler-data-transport.mjs +27 -31
  471. package/tools/backends/compiler-host-iteration.mjs +13 -21
  472. package/tools/backends/compiler-host-record.mjs +28 -34
  473. package/tools/backends/compiler-metadata.mjs +145 -53
  474. package/tools/backends/compiler-package-ground.mjs +39 -47
  475. package/tools/backends/compiler-package-loader.mjs +164 -206
  476. package/tools/backends/compiler-session.mjs +432 -324
  477. package/tools/backends/compiler-worker.mjs +79 -89
  478. package/tools/backends/dist/bootstrap-js-stages.mjs +17 -19
  479. package/tools/backends/dist/bootstrap-js-stages.mjs.map +1 -1
  480. package/tools/backends/dist/managed-ir-inventory.mjs +1 -1
  481. package/tools/backends/dist/managed-ir-inventory.mjs.map +1 -1
  482. package/tools/backends/dist/release-cli.mjs +151 -22
  483. package/tools/backends/dist/release-cli.mjs.map +1 -1
  484. package/tools/backends/dist/run-artifact.mjs +54 -76
  485. package/tools/backends/dist/run-artifact.mjs.map +1 -1
  486. package/tools/backends/managed-foreign-binding.mjs +370 -114
  487. package/tools/backends/managed-host-ground.mjs +14 -17
  488. package/tools/backends/managed-host-lifecycle.mjs +42 -53
  489. package/tools/backends/managed-host-object-realm.mjs +121 -111
  490. package/tools/backends/managed-host-proxy.mjs +5 -7
  491. package/tools/backends/managed-host-runtime.mjs +6295 -4350
  492. package/tools/backends/managed-host.mjs +234 -188
  493. package/tools/backends/managed-layout.mjs +53 -56
  494. package/tools/backends/managed-module-graph-ground.mjs +488 -568
  495. package/tools/backends/managed-module-graph.mjs +62 -76
  496. package/tools/backends/managed-runtime-host-ground.mjs +352 -400
  497. package/tools/backends/managed-runtime.mjs +227 -266
  498. package/tools/backends/managed-source-view-ground.mjs +165 -161
  499. package/tools/backends/managed-source-view.mjs +415 -154
  500. package/tools/backends/native-managed-runtime.mjs +96 -138
  501. package/tools/backends/native-memory.mjs +1122 -742
  502. package/tools/backends/native-node-ffi.mjs +2439 -0
  503. package/tools/backends/native-node-memory.mjs +793 -383
  504. package/tools/backends/native-node-runner.mjs +1458 -579
  505. package/tools/backends/native-node-watchdog.mjs +12 -14
  506. package/tools/backends/native-node-worker.mjs +46 -50
  507. package/tools/backends/stage3-targets.mjs +2 -2
  508. package/tools/bootstrap-runtime.el +4 -4
  509. package/tools/collections/transient-builder-benchmark.mjs +17 -17
  510. package/tools/project/check-cli.eli +27 -3
  511. package/tools/project/project-cli.eli +1 -1
  512. package/tools/testing/maintained-suite-source.mjs +5 -7
  513. package/tools/testing/maintained-suite-source.mjs.map +1 -1
  514. package/dist/literal-sources/stdlib/core/data.eli +0 -306
  515. package/dist/literal-sources/stdlib/managed-transient-state.eli +0 -353
  516. package/stdlib/core/data-text.eli +0 -16
  517. package/stdlib/core/data.eli +0 -306
  518. package/stdlib/core/identifier.eli +0 -32
  519. package/stdlib/core/regex.eli +0 -17
  520. package/stdlib/deferred.eli +0 -70
  521. package/stdlib/managed-runtime-lazy-sequence.eli +0 -157
  522. package/stdlib/managed-transient-state.eli +0 -353
  523. /package/{stdlib → runtime/managed}/managed-protocol-error.eli +0 -0
  524. /package/{stdlib → runtime/managed}/managed-runtime-literals.eli +0 -0
  525. /package/{stdlib → runtime/managed}/managed-runtime-truth.eli +0 -0
  526. /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
- return (() => {
367
- try {
368
- return thunk();
369
- } catch (error) {
370
- if ((!((error == null)) && __eliscript_truthy((error)["eliscriptThrow"]) && !(__eliscript_truthy((error)["clBlock"])) && ((error)["tag"] === tag))) {
371
- return (error)["value"];
372
- } else {
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
- return (() => {
383
- try {
384
- {
385
- let value = body_thunk();
386
- if ((success_fn === null)) {
387
- return value;
388
- } else {
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
- let signal = el_error_from_host(raw);
398
- let condition = (signal)["conditionSymbol"];
399
- let matched = (handlers)["find"](((h) => {
400
- return ((h)["conds"])["some"](((c) => {
401
- return ((__eliscript_value_5) => (__eliscript_truthy(__eliscript_value_5) ? el_condition_matches(session, condition, c) : __eliscript_value_5))(((__eliscript_value_6, __eliscript_value_7) => (__eliscript_value_6 !== __eliscript_value_7))(c, "debug"));
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
- if ((matched === undefined)) {
405
- ((__eliscript_value_8) => { throw __eliscript_value_8; })(raw);
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
- return (() => {
414
- try {
415
- return thunk();
416
- } catch (raw) {
417
- if (__eliscript_truthy(el_control_transfer_QMARK_(raw))) {
418
- ((__eliscript_value_9) => { throw __eliscript_value_9; })(raw);
419
- }
420
- {
421
- let signal = el_error_from_host(raw);
422
- if (__eliscript_truthy(el_condition_matches(session, (signal)["conditionSymbol"], "error"))) {
423
- return null;
424
- } else {
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
- return (() => {
433
- try {
434
- return thunk();
435
- } catch (raw) {
436
- if (__eliscript_truthy(el_control_transfer_QMARK_(raw))) {
437
- ((__eliscript_value_11) => { throw __eliscript_value_11; })(raw);
438
- }
439
- {
440
- let signal = el_error_from_host(raw);
441
- if (__eliscript_truthy((conds)["some"](((c) => {
442
- return el_condition_matches(session, (signal)["conditionSymbol"], c);
443
- })))) {
444
- return null;
445
- } else {
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
- return (() => {
456
- try {
457
- return thunk();
458
- } finally {
459
- ((session)["matchData"] = saved);
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
- return (() => {
469
- try {
470
- return thunk();
471
- } finally {
472
- ((session)["currentBuffer"] = buffer);
473
- ((buffer)["point"] = el_clamp_position(buffer, point));
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
- return (() => {
482
- try {
483
- return thunk();
484
- } finally {
485
- if (__eliscript_truthy((buffer)["live"])) {
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
- return (() => {
500
- try {
501
- return thunk();
502
- } finally {
503
- if (__eliscript_truthy((buffer)["live"])) {
504
- if (__eliscript_truthy(was_narrowed)) {
505
- {
506
- let len = (((buffer)["text"]) ?? []).length;
507
- ((buffer)["narrowMin"] = Math.max(1, Math.min(saved_min, (len + 1))));
508
- ((buffer)["narrowMax"] = Math.max((buffer)["narrowMin"], __eliscript_numeric_sub((len + 1), tail_offset)));
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
- return (() => {
522
- try {
523
- return thunk();
524
- } catch (raw) {
525
- if (__eliscript_truthy(el_control_transfer_QMARK_(raw))) {
526
- ((__eliscript_value_13) => { throw __eliscript_value_13; })(raw);
527
- }
528
- {
529
- let signal = el_error_from_host(raw);
530
- let condition = (signal)["conditionSymbol"];
531
- if (__eliscript_truthy(el_condition_matches(session, condition, "error"))) {
532
- {
533
- let err_val = el_cons(el_intern(condition), el_list_from((signal)["data"]));
534
- let fmt_str = (__eliscript_truthy(el_string_QMARK_(fmt_val)) ? fmt_val : "Error: %S");
535
- let text = (() => {
536
- try {
537
- return el_format(session, fmt_str, [err_val]);
538
- } catch (_) {
539
- return (String(fmt_str) + String(" ") + String(el_prin1_string(err_val, true)));
540
- }
541
- })();
542
- el_emit_output(session, (String(text) + String("\n")), true);
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
- return (() => {
558
- try {
559
- return thunk();
560
- } finally {
561
- el_kill_buffer(session, buffer);
562
- ((session)["currentBuffer"] = previous);
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
- return (() => {
573
- try {
574
- {
575
- let res = thunk();
576
- el_call(session, el_intern("write-region"), [1, el_point_max(buffer), file, null, el_intern("silent")]);
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
- return (() => {
593
- try {
594
- return body_thunk();
595
- } catch (err) {
596
- if ((!((err == null)) && __eliscript_truthy((err)["eliscriptTimeout"]) && ((err)["deadline"] === deadline))) {
597
- return timeout_thunk();
598
- } else {
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
- return (() => {
613
- try {
614
- return thunk();
615
- } finally {
616
- ((session)["currentBuffer"] = previous);
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
- return (() => {
626
- try {
627
- thunk();
628
- return __eliscript_at_direct((session)["output"], "join", "");
629
- } finally {
630
- ((session)["output"] = saved);
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 ((__eliscript_value_16) => (__eliscript_truthy(__eliscript_value_16) ? ((__eliscript_value_17) => (__eliscript_truthy(__eliscript_value_17) ? rt_pcase_qpat(session, (qpat)["cdr"], (value)["cdr"], setter) : __eliscript_value_17))(rt_pcase_qpat(session, (qpat)["car"], (value)["car"], setter)) : __eliscript_value_16))(el_cons_QMARK_(value));
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 ((__eliscript_value_18) => (__eliscript_truthy(__eliscript_value_18) ? ((__eliscript_value_19) => (__eliscript_truthy(__eliscript_value_19) ? ((qpat)["items"])["every"](((q, index) => {
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
- })) : __eliscript_value_19))(((((qpat)["items"]) ?? []).length === (((value)["items"]) ?? []).length)) : __eliscript_value_18))(el_vector_QMARK_(value));
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(((__eliscript_value_20) => (__eliscript_truthy(__eliscript_value_20) ? __eliscript_value_20 : el_struct_instance_QMARK_(session, x, name)))(((!(x === null)) && ((x)["kind"] === "record") && (((x)["items"])[0] === type_symbol))));
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
- ((__eliscript_value_21) => { throw __eliscript_value_21; })(el_make_signal("ert-test-failed", [el_list(el_intern("should"), expr_datum)]));
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
- ((__eliscript_value_22) => { throw __eliscript_value_22; })(el_make_signal("ert-test-failed", [el_list(el_intern("should-not"), expr_datum), el_intern(":value"), val]));
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
- try {
1785
- return thunk();
1786
- } catch (raw) {
1787
- if (__eliscript_truthy(el_control_transfer_QMARK_(raw))) {
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
- ((__eliscript_value_24) => { throw __eliscript_value_24; })(el_make_signal("ert-test-failed", [el_list(el_intern("should-error"), expr_datum)]));
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
- ((__eliscript_value_25) => { throw __eliscript_value_25; })(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"]))]));
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
- return (() => {
1890
- try {
1891
- {
1892
- let value = inner_fn(args);
1893
- if ((el_kind(value) === "future")) {
1894
- return value;
1895
- } else {
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
- return (() => {
1915
- try {
1916
- return body_fn(scope);
1917
- } finally {
1918
- ((scope)["handles"])["forEach"](((handle) => {
1919
- {
1920
- let revoke = el_symbol_function(session, el_intern("engine-revoke!"));
1921
- if ((!(revoke === null))) {
1922
- return revoke(handle);
1923
- } else {
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
- return (() => {
1937
- try {
1938
- return thunk();
1939
- } finally {
1940
- ((session)["abiMemory"] = previous);
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": (((__eliscript_value_27) => (__eliscript_truthy(__eliscript_value_27) ? __eliscript_value_27 : []))((source)["items"]))["slice"]()});
1948
- return (() => {
1949
- try {
1950
- body_fn(builder);
1951
- ((builder)["active"] = false);
1952
- return el_make_pcoll("persistent-vector", (builder)["items"]);
1953
- } finally {
1954
- ((builder)["active"] = false);
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": ((__eliscript_value_28) => (__eliscript_truthy(__eliscript_value_28) ? __eliscript_value_28 : (ctx)["dynamicMode"]))(force_dyn)}));
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
- return (() => {
2524
- try {
2525
- if (__eliscript_truthy(sequential)) {
2526
- {
2527
- let decls = [(String("(") + String(dyn_var) + String(" (js-array))"))];
2528
- let steps = [];
2529
- (raw_bindings)["forEach"](((b) => {
2530
- {
2531
- let sym = (__eliscript_truthy(el_cons_QMARK_(b)) ? (b)["car"] : b);
2532
- let val_form = (__eliscript_truthy(el_cons_QMARK_(b)) ? el_car((b)["cdr"]) : null);
2533
- let val_expr = compile_expr(ctx, next_cenv, val_form);
2534
- let js_var = ctx_gensym(ctx, "v");
2535
- let sym_expr = ctx_sym(ctx, (sym)["name"]);
2536
- let cur_bind_fn = ctx_bind_fn(ctx, is_const, force_dyn);
2537
- (decls)["push"]((String("(") + String(js_var) + String(" nil)")));
2538
- (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("))")));
2539
- cenv_set_var(ctx, next_cenv, (sym)["name"], js_var, sym_expr, is_const, force_dyn);
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((e)["valForm"]);
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
- (bind_steps)["push"](compile_list_body(ctx, next_cenv, body_list));
2592
- 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("))))"));
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 = ((__eliscript_value_29) => (__eliscript_truthy(__eliscript_value_29) ? (!__eliscript_truthy((((eval_cenv)["vars"])["get"](name))["isDynamic"])) : __eliscript_value_29))(((eval_cenv)["vars"])["has"](name));
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 ((__eliscript_value_30) => (__eliscript_truthy(__eliscript_value_30) ? el_sym_is(token, name) : __eliscript_value_30))((!(token === undefined)));
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
- try {
3959
- return el_eval(csession, form, el_root_env());
3960
- } catch (_) {
3961
- return null;
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 ((__eliscript_value_31) => (__eliscript_truthy(__eliscript_value_31) ? el_sym_is((h)["car"], ":success") : __eliscript_value_31))(el_cons_QMARK_(h));
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 ((__eliscript_value_32) => (__eliscript_truthy(__eliscript_value_32) ? (!__eliscript_truthy(((csession)["userDefinedFns"])["has"](sym_name))) : __eliscript_value_32))(((csession)["activeLibs"])["has"](lib_name));
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
- try {
4784
- return el_eval_body(csession, el_list_to_array((form)["cdr"]), el_root_env());
4785
- } catch (_) {
4786
- return null;
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
- try {
5046
- return ((csession)["values"])["set"](sym, el_eval(csession, val_form, el_root_env()));
5047
- } catch (_) {
5048
- return null;
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
- try {
5078
- return el_eval(csession, form, el_root_env());
5079
- } catch (_) {
5080
- return null;
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
- try {
5096
- return el_eval(csession, form, el_root_env());
5097
- } catch (_) {
5098
- return null;
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
- try {
5494
- return el_eval(csession, form, el_root_env());
5495
- } catch (_) {
5496
- return null;
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
- try {
5504
- return el_eval(csession, form, el_root_env());
5505
- } catch (_) {
5506
- return null;
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
- return (() => {
6230
- try {
6231
- return (fs_mod)["realpathSync"](filename);
6232
- } catch (_err) {
6233
- return filename;
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
- return (() => {
6251
- try {
6252
- {
6253
- let result = (() => {
6254
- try {
6255
- if (__eliscript_truthy(el_string_QMARK_(filename))) {
6256
- rt_bind_dyn(session, el_intern("load-file-name"), filename, dyn);
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
- return result;
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
- return ((__eliscript_value_33) => { throw __eliscript_value_33; })(err);
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
- return (() => {
6290
- try {
6291
- return load_fn(session);
6292
- } catch (err) {
6293
- if ((!((err == null)) && (__eliscript_truthy((err)["eliscriptBatchExit"]) || __eliscript_truthy((err)["eliscriptKillEmacs"])))) {
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"](255);
6238
+ return (p)["exit"]((__eliscript_truthy(el_integer_QMARK_(status)) ? status : 0));
6306
6239
  } else {
6307
- return ((__eliscript_value_34) => { throw __eliscript_value_34; })(err);
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 = ((__eliscript_value_35) => (__eliscript_truthy(__eliscript_value_35) ? (options)["autorun"] : __eliscript_value_35))((!(options == null)));
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 = ((__eliscript_value_36) => (__eliscript_truthy(__eliscript_value_36) ? __eliscript_numeric_relation(">", ((source_file) ?? []).length, 0) : __eliscript_value_36))(el_string_QMARK_(source_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);