diff --git a/Makefile b/Makefile
index d125f760e..00e2a2590 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
.PHONY: publish test coveralls lint zero coverage
-VERSION=1.0.0-beta.16
-VERSION_DASH=`echo -n "1.0.0-beta.16" | sed "s/-/%E2%80%93/"`
+VERSION=1.0.0-beta.17
+VERSION_DASH=`echo -n "1.0.0-beta.17" | sed "s/-/%E2%80%93/"`
BRANCH=`git branch | grep '^*' | sed 's/* //'`
DATE=`date -uR`
YEAR=`date +%Y`
diff --git a/README.md b/README.md
index cf544d763..9c8293e52 100644
--- a/README.md
+++ b/README.md
@@ -1,13 +1,13 @@
-
-[![npm](https://img.shields.io/badge/npm-1.0.0%E2%80%93beta.16-blue.svg)](https://www.npmjs.com/package/@jcubic/lips)
+[![npm](https://img.shields.io/badge/npm-1.0.0%E2%80%93beta.17-blue.svg)](https://www.npmjs.com/package/@jcubic/lips)
![1.0.0 Complete](https://img.shields.io/github/milestones/progress-percent/jcubic/lips/1?label=1.0.0%20Complete)
-[![Build and test](https://github.com/jcubic/lips/actions/workflows/build.yaml/badge.svg?branch=devel&event=push)](https://github.com/jcubic/lips/actions/workflows/build.yaml)
-[![Coverage Status](https://coveralls.io/repos/github/jcubic/lips/badge.svg?branch=devel&1eb2cfbcb9a646f24938a31ec46bbc33)](https://coveralls.io/github/jcubic/lips?branch=devel)
+[![Build and test](https://github.com/jcubic/lips/actions/workflows/build.yaml/badge.svg?branch=master&event=push)](https://github.com/jcubic/lips/actions/workflows/build.yaml)
+[![Coverage Status](https://coveralls.io/repos/github/jcubic/lips/badge.svg?branch=master&1eb2cfbcb9a646f24938a31ec46bbc33)](https://coveralls.io/github/jcubic/lips?branch=master)
[![Join Gitter Chat](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/jcubic/lips)
![NPM Download Count](https://img.shields.io/npm/dm/@jcubic/lips)
![JSDelivr Download count](https://img.shields.io/jsdelivr/npm/hm/@jcubic/lips)
@@ -160,7 +160,7 @@ npm install -g @jcubic/lips@beta
you can run the interpreter from the terminal:
-![LIPS: Scheme interactive terminal](https://github.com/jcubic/lips/blob/devel/assets/screencast.gif?raw=true)
+![LIPS: Scheme interactive terminal](https://github.com/jcubic/lips/blob/master/assets/screencast.gif?raw=true)
You can also run code in a string with:
@@ -199,14 +199,14 @@ Executables also return a S-Expression according to SRFI-176 use `lips --version
## FOSDEM'23 Presentation [Video]
-[![FOSDEM 2023 - LIPS Scheme: Powerful introspection and extensibility](https://github.com/jcubic/lips/blob/devel/assets/fosdem-intro.png?raw=true)](https://fosdem.org/2023/schedule/event/lipsscheme/)
+[![FOSDEM 2023 - LIPS Scheme: Powerful introspection and extensibility](https://github.com/jcubic/lips/blob/master/assets/fosdem-intro.png?raw=true)](https://fosdem.org/2023/schedule/event/lipsscheme/)
## Limitations
Because LIPS is tree walking interpreter sometimes it may be slow. Especially if you want to
process long arrays and use callback function. If the array is quite large each piece of code
inside the callback may slow down the processing. For example see:
-script [reference.scm](https://github.com/jcubic/lips/blob/devel/scripts/reference.scm)
+script [reference.scm](https://github.com/jcubic/lips/blob/master/scripts/reference.scm)
That generates reference documentation for all builtin functions and macros.
The slow part is `(names.sort name-compare)` (`Array::sort`) that take quite time to calculate,
diff --git a/dist/lips.js b/dist/lips.js
index b71748e5f..678d53ab5 100644
--- a/dist/lips.js
+++ b/dist/lips.js
@@ -4,7 +4,7 @@
* | | \ \ | | | || . \/ __> | |
* | | > \ | |_ | || _/\__ \ | |
* | | / ^ \ |___||_||_| <___/ | |
- * \_\ /_/ \_\ /_/ v. DEV
+ * \_\ /_/ \_\ /_/ v. 1.0.0-beta.17
*
* LIPS is Pretty Simple - Scheme based Powerful LISP in JavaScript
*
@@ -31,7 +31,7 @@
* Copyright (c) 2014-present, Facebook, Inc.
* released under MIT license
*
- * build: Wed, 22 Nov 2023 13:53:23 +0000
+ * build: Sat, 23 Dec 2023 13:40:35 +0000
*/
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -5799,7 +5799,7 @@
* The rationalize algorithm is by Per M.A. Bothner, Alan Bawden and Marc Feeley.
* source: Kawa, C-Gambit
*
- * Build time: Wed, 22 Nov 2023 13:53:23 +0000
+ * Build time: Sat, 23 Dec 2023 13:40:35 +0000
*/
var _excluded = ["token"],
_excluded2 = ["stderr", "stdin", "stdout", "command_line"];
@@ -19582,10 +19582,10 @@
var banner = function () {
// Rollup tree-shaking is removing the variable if it's normal string because
- // obviously 'Wed, 22 Nov 2023 13:53:23 +0000' == '{{' + 'DATE}}'; can be removed
+ // obviously 'Sat, 23 Dec 2023 13:40:35 +0000' == '{{' + 'DATE}}'; can be removed
// but disabling Tree-shaking is adding lot of not used code so we use this
// hack instead
- var date = LString('Wed, 22 Nov 2023 13:53:23 +0000').valueOf();
+ var date = LString('Sat, 23 Dec 2023 13:40:35 +0000').valueOf();
var _date = date === '{{' + 'DATE}}' ? new Date() : new Date(date);
@@ -19597,7 +19597,7 @@
var _build = [_year, _format(_date.getMonth() + 1), _format(_date.getDate())].join('-');
- var banner = "\n __ __ __\n / / \\ \\ _ _ ___ ___ \\ \\\n| | \\ \\ | | | || . \\/ __> | |\n| | > \\ | |_ | || _/\\__ \\ | |\n| | / ^ \\ |___||_||_| <___/ | |\n \\_\\ /_/ \\_\\ /_/\n\nLIPS Interpreter DEV (".concat(_build, ") \nCopyright (c) 2018-").concat(_year, " Jakub T. Jankiewicz\n\nType (env) to see environment with functions macros and variables. You can also\nuse (help name) to display help for specific function or macro, (apropos name)\nto display list of matched names in environment and (dir object) to list\nproperties of an object.\n").replace(/^.*\n/, '');
+ var banner = "\n __ __ __\n / / \\ \\ _ _ ___ ___ \\ \\\n| | \\ \\ | | | || . \\/ __> | |\n| | > \\ | |_ | || _/\\__ \\ | |\n| | / ^ \\ |___||_||_| <___/ | |\n \\_\\ /_/ \\_\\ /_/\n\nLIPS Interpreter 1.0.0-beta.17 (".concat(_build, ") \nCopyright (c) 2018-").concat(_year, " Jakub T. Jankiewicz\n\nType (env) to see environment with functions macros and variables. You can also\nuse (help name) to display help for specific function or macro, (apropos name)\nto display list of matched names in environment and (dir object) to list\nproperties of an object.\n").replace(/^.*\n/, '');
return banner;
}(); // -------------------------------------------------------------------------
// to be used with string function when code is minified
@@ -19629,9 +19629,9 @@
read_only(QuotedPromise, '__class__', 'promise'); // -------------------------------------------------------------------------
var lips = {
- version: 'DEV',
+ version: '1.0.0-beta.17',
banner: banner,
- date: 'Wed, 22 Nov 2023 13:53:23 +0000',
+ date: 'Sat, 23 Dec 2023 13:40:35 +0000',
exec: exec,
// unwrap async generator into Promise
parse: compose(uniterate_async, parse),
diff --git a/dist/lips.min.js b/dist/lips.min.js
index e4d9092ff..6c70bd899 100644
--- a/dist/lips.min.js
+++ b/dist/lips.min.js
@@ -4,7 +4,7 @@
* | | \ \ | | | || . \/ __> | |
* | | > \ | |_ | || _/\__ \ | |
* | | / ^ \ |___||_||_| <___/ | |
- * \_\ /_/ \_\ /_/ v. DEV
+ * \_\ /_/ \_\ /_/ v. 1.0.0-beta.17
*
* LIPS is Pretty Simple - Scheme based Powerful LISP in JavaScript
*
@@ -31,7 +31,7 @@
* Copyright (c) 2014-present, Facebook, Inc.
* released under MIT license
*
- * build: Wed, 22 Nov 2023 13:53:23 +0000
+ * build: Sat, 23 Dec 2023 13:40:35 +0000
*/
(function(e,t){typeof exports==="object"&&typeof module!=="undefined"?module.exports=t():typeof define==="function"&&define.amd?define(t):(e=typeof globalThis!=="undefined"?globalThis:e||self,e.lips=t())})(this,function(){"use strict";function i(e){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function o(e,t){o=Object.setPrototypeOf||function e(t,r){t.__proto__=r;return t};return o(e,t)}function n(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));return true}catch(e){return false}}function p(e,t,r){if(n()){p=Reflect.construct}else{p=function e(t,r,n){var i=[null];i.push.apply(i,r);var u=Function.bind.apply(t,i);var a=new u;if(n)o(a,n.prototype);return a}}return p.apply(null,arguments)}function u(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function")}e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:true,configurable:true}});Object.defineProperty(e,"prototype",{writable:false});if(t)o(e,t)}function _(e){"@babel/helpers - typeof";return _="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_(e)}function a(e,t){if(t&&(_(t)==="object"||typeof t==="function")){return t}else if(t!==void 0){throw new TypeError("Derived constructors may only return object or undefined")}return i(e)}function c(e){c=Object.setPrototypeOf?Object.getPrototypeOf:function e(t){return t.__proto__||Object.getPrototypeOf(t)};return c(e)}function r(e){if(Array.isArray(e))return e}function t(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function f(e,t){if(t==null||t>e.length)t=e.length;for(var r=0,n=new Array(t);r=0)continue;r[i]=e[i]}return r}function F(e,t){if(e==null)return{};var r=x(e,t);var n,i;if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);for(i=0;i=0)continue;if(!Object.prototype.propertyIsEnumerable.call(e,n))continue;r[n]=e[n]}}return r}function k(e,t){var r=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(r==null)return;var n=[];var i=true;var u=false;var a,o;try{for(r=r.call(e);!(i=(a=r.next()).done);i=true){n.push(a.value);if(t&&n.length===t)break}}catch(e){u=true;o=e}finally{try{if(!i&&r["return"]!=null)r["return"]()}finally{if(u)throw o}}return n}function j(e,t){return r(e)||k(e,t)||l(e,t)||d()}function I(e){this.wrapped=e}function P(e){return new I(e)}function N(u){var a,o;function e(n,i){return new Promise(function(e,t){var r={key:n,arg:i,resolve:e,reject:t,next:null};if(o){o=o.next=r}else{a=o=r;s(n,i)}})}function s(t,e){try{var r=u[t](e);var n=r.value;var i=n instanceof I;Promise.resolve(i?n.wrapped:n).then(function(e){if(i){s(t==="return"?"return":"next",e);return}c(r.done?"return":"normal",e)},function(e){s("throw",e)})}catch(e){c("throw",e)}}function c(e,t){switch(e){case"return":a.resolve({value:t,done:true});break;case"throw":a.reject(t);break;default:a.resolve({value:t,done:false});break}a=a.next;if(a){s(a.key,a.arg)}else{o=null}}this._invoke=e;if(typeof u["return"]!=="function"){this["return"]=undefined}}N.prototype[typeof Symbol==="function"&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this};N.prototype.next=function(e){return this._invoke("next",e)};N.prototype["throw"]=function(e){return this._invoke("throw",e)};N.prototype["return"]=function(e){return this._invoke("return",e)};function e(e){return function(){return new N(e.apply(this,arguments))}}function R(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e["default"]:e}var T={exports:{}};var V={exports:{}};(function(e){var t=function(a){var e=Object.prototype;var f=e.hasOwnProperty;var s;var o=typeof Symbol==="function"?Symbol:{};var i=o.iterator||"@@iterator";var c=o.asyncIterator||"@@asyncIterator";var p=o.toStringTag||"@@toStringTag";function r(e,t,r){Object.defineProperty(e,t,{value:r,enumerable:true,configurable:true,writable:true});return e[t]}try{r({},"")}catch(e){r=function(e,t,r){return e[t]=r}}function _(e,t,r,n){var i=t&&t.prototype instanceof g?t:g;var u=Object.create(i.prototype);var a=new O(n||[]);u._invoke=x(e,r,a);return u}a.wrap=_;function d(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}var v="suspendedStart";var y="suspendedYield";var m="executing";var l="completed";var h={};function g(){}function n(){}function t(){}var b={};r(b,i,function(){return this});var w=Object.getPrototypeOf;var D=w&&w(w(S([])));if(D&&D!==e&&f.call(D,i)){b=D}var u=t.prototype=g.prototype=Object.create(b);n.prototype=t;r(u,"constructor",t);r(t,"constructor",n);n.displayName=r(t,p,"GeneratorFunction");function E(e){["next","throw","return"].forEach(function(t){r(e,t,function(e){return this._invoke(t,e)})})}a.isGeneratorFunction=function(e){var t=typeof e==="function"&&e.constructor;return t?t===n||(t.displayName||t.name)==="GeneratorFunction":false};a.mark=function(e){if(Object.setPrototypeOf){Object.setPrototypeOf(e,t)}else{e.__proto__=t;r(e,p,"GeneratorFunction")}e.prototype=Object.create(u);return e};a.awrap=function(e){return{__await:e}};function A(o,s){function c(e,t,r,n){var i=d(o[e],o,t);if(i.type==="throw"){n(i.arg)}else{var u=i.arg;var a=u.value;if(a&&typeof a==="object"&&f.call(a,"__await")){return s.resolve(a.__await).then(function(e){c("next",e,r,n)},function(e){c("throw",e,r,n)})}return s.resolve(a).then(function(e){u.value=e;r(u)},function(e){return c("throw",e,r,n)})}}var t;function e(r,n){function e(){return new s(function(e,t){c(r,n,e,t)})}return t=t?t.then(e,e):e()}this._invoke=e}E(A.prototype);r(A.prototype,c,function(){return this});a.AsyncIterator=A;a.async=function(e,t,r,n,i){if(i===void 0)i=Promise;var u=new A(_(e,t,r,n),i);return a.isGeneratorFunction(t)?u:u.next().then(function(e){return e.done?e.value:u.next()})};function x(a,o,s){var c=v;return function e(t,r){if(c===m){throw new Error("Generator is already running")}if(c===l){if(t==="throw"){throw r}return B()}s.method=t;s.arg=r;while(true){var n=s.delegate;if(n){var i=F(n,s);if(i){if(i===h)continue;return i}}if(s.method==="next"){s.sent=s._sent=s.arg}else if(s.method==="throw"){if(c===v){c=l;throw s.arg}s.dispatchException(s.arg)}else if(s.method==="return"){s.abrupt("return",s.arg)}c=m;var u=d(a,o,s);if(u.type==="normal"){c=s.done?l:y;if(u.arg===h){continue}return{value:u.arg,done:s.done}}else if(u.type==="throw"){c=l;s.method="throw";s.arg=u.arg}}}}function F(e,t){var r=e.iterator[t.method];if(r===s){t.delegate=null;if(t.method==="throw"){if(e.iterator["return"]){t.method="return";t.arg=s;F(e,t);if(t.method==="throw"){return h}}t.method="throw";t.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var n=d(r,e.iterator,t.arg);if(n.type==="throw"){t.method="throw";t.arg=n.arg;t.delegate=null;return h}var i=n.arg;if(!i){t.method="throw";t.arg=new TypeError("iterator result is not an object");t.delegate=null;return h}if(i.done){t[e.resultName]=i.value;t.next=e.nextLoc;if(t.method!=="return"){t.method="next";t.arg=s}}else{return i}t.delegate=null;return h}E(u);r(u,p,"Generator");r(u,i,function(){return this});r(u,"toString",function(){return"[object Generator]"});function k(e){var t={tryLoc:e[0]};if(1 in e){t.catchLoc=e[1]}if(2 in e){t.finallyLoc=e[2];t.afterLoc=e[3]}this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal";delete t.arg;e.completion=t}function O(e){this.tryEntries=[{tryLoc:"root"}];e.forEach(k,this);this.reset(true)}a.keys=function(r){var n=[];for(var e in r){n.push(e)}n.reverse();return function e(){while(n.length){var t=n.pop();if(t in r){e.value=t;e.done=false;return e}}e.done=true;return e}};function S(t){if(t){var e=t[i];if(e){return e.call(t)}if(typeof t.next==="function"){return t}if(!isNaN(t.length)){var r=-1,n=function e(){while(++r=0;--t){var i=this.tryEntries[t];var u=i.completion;if(i.tryLoc==="root"){return e("end")}if(i.tryLoc<=this.prev){var a=f.call(i,"catchLoc");var o=f.call(i,"finallyLoc");if(a&&o){if(this.prev=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&f.call(n,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e){this.complete(r.completion,r.afterLoc);C(r);return h}}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if(n.type==="throw"){var i=n.arg;C(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){this.delegate={iterator:S(e),resultName:t,nextLoc:r};if(this.method==="next"){this.arg=s}return h}};return a}(e.exports);try{regeneratorRuntime=t}catch(e){if(typeof globalThis==="object"){globalThis.regeneratorRuntime=t}else{Function("r","regeneratorRuntime = r")(t)}}})(V);(function(e){e.exports=V.exports})(T);var z=R(T.exports);var $=typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{};var J=[];var K=[];var G=typeof Uint8Array!=="undefined"?Uint8Array:Array;var H=false;function W(){H=true;var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var t=0,r=e.length;t0){throw new Error("Invalid string. Length must be a multiple of 4")}u=e[o-2]==="="?2:e[o-1]==="="?1:0;a=new G(o*3/4-u);n=u>0?o-4:o;var s=0;for(t=0,r=0;t>16&255;a[s++]=i>>8&255;a[s++]=i&255}if(u===2){i=K[e.charCodeAt(t)]<<2|K[e.charCodeAt(t+1)]>>4;a[s++]=i&255}else if(u===1){i=K[e.charCodeAt(t)]<<10|K[e.charCodeAt(t+1)]<<4|K[e.charCodeAt(t+2)]>>2;a[s++]=i>>8&255;a[s++]=i&255}return a}function Z(e){return J[e>>18&63]+J[e>>12&63]+J[e>>6&63]+J[e&63]}function X(e,t,r){var n;var i=[];for(var u=t;us?s:o+a))}if(n===1){t=e[r-1];i+=J[t>>2];i+=J[t<<4&63];i+="=="}else if(n===2){t=(e[r-2]<<8)+e[r-1];i+=J[t>>10];i+=J[t>>4&63];i+=J[t<<2&63];i+="="}u.push(i);return u.join("")}function te(e,t,r,n,f){var i,u;var l=f*8-n-1;var h=(1<>1;var a=-7;var o=r?f-1:0;var s=r?-1:1;var c=e[t+o];o+=s;i=c&(1<<-a)-1;c>>=-a;a+=l;for(;a>0;i=i*256+e[t+o],o+=s,a-=8){}u=i&(1<<-a)-1;i>>=-a;a+=n;for(;a>0;u=u*256+e[t+o],o+=s,a-=8){}if(i===0){i=1-p}else if(i===h){return u?NaN:(c?-1:1)*Infinity}else{u=u+Math.pow(2,n);i=i-p}return(c?-1:1)*u*Math.pow(2,i-n)}function re(e,t,f,l,r,h){var n,i,u;var a=h*8-r-1;var o=(1<>1;var p=r===23?Math.pow(2,-24)-Math.pow(2,-77):0;var c=l?0:h-1;var _=l?1:-1;var d=t<0||t===0&&1/t<0?1:0;t=Math.abs(t);if(isNaN(t)||t===Infinity){i=isNaN(t)?1:0;n=o}else{n=Math.floor(Math.log(t)/Math.LN2);if(t*(u=Math.pow(2,-n))<1){n--;u*=2}if(n+s>=1){t+=p/u}else{t+=p*Math.pow(2,1-s)}if(t*u>=2){n++;u/=2}if(n+s>=o){i=0;n=o}else if(n+s>=1){i=(t*u-1)*Math.pow(2,r);n=n+s}else{i=t*Math.pow(2,s-1)*Math.pow(2,r);n=0}}for(;r>=8;e[f+c]=i&255,c+=_,i/=256,r-=8){}n=n<0;e[f+c]=n&255,c+=_,n/=256,a-=8){}e[f+c-_]|=d*128}var ne={}.toString;var ie=Array.isArray||function(e){return ne.call(e)=="[object Array]"};
/*!
@@ -83,5 +83,5 @@
* The rationalize algorithm is by Per M.A. Bothner, Alan Bawden and Marc Feeley.
* source: Kawa, C-Gambit
*
- * Build time: Wed, 22 Nov 2023 13:53:23 +0000
- */var sn=["token"],cn=["stderr","stdin","stdout","command_line"];function fn(i){var u=ln();return function e(){var t=c(i),r;if(u){var n=c(this).constructor;r=Reflect.construct(t,arguments,n)}else{r=t.apply(this,arguments)}return a(this,r)}}function ln(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));return true}catch(e){return false}}function hn(t,e){var r=typeof Symbol!=="undefined"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=pn(t))||e&&t&&typeof t.length==="number"){if(r)t=r;var n=0;var i=function e(){};return{s:i,n:function e(){if(n>=t.length)return{done:true};return{done:false,value:t[n++]}},e:function e(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var u=true,a=false,o;return{s:function e(){r=r.call(t)},n:function e(){var t=r.next();u=t.done;return t},e:function e(t){a=true;o=t},f:function e(){try{if(!u&&r["return"]!=null)r["return"]()}finally{if(a)throw o}}}}function pn(e,t){if(!e)return;if(typeof e==="string")return _n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor)r=e.constructor.name;if(r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _n(e,t)}function _n(e,t){if(t==null||t>e.length)t=e.length;for(var r=0,n=new Array(t);r1&&arguments[1]!==undefined?arguments[1]:null;var n=arguments[1]===true;function t(e){if(!Cn()){return}var t=qo.get("repr")(e);if(r===null||r instanceof RegExp&&r.test(t)){console.log(qo.get("type")(e)+": "+t)}if(n){console.log(e)}}if(ra(e)){e.then(t)}else{t(e)}return e}function Cn(){return Yo&&Yo.get("DEBUG",{throwError:false})}function On(e){return e?"(?:#".concat(e,"(?:#[ie])?|#[ie]#").concat(e,")"):"(?:#[ie])?"}function Sn(e,t){return"".concat(On(e),"[+-]?").concat(t,"+/").concat(t,"+")}function Bn(e,t){return"".concat(On(e),"(?:[+-]?(?:").concat(t,"+/").concat(t,"+|nan.0|inf.0|").concat(t,"+))?(?:[+-]i|[+-]?(?:").concat(t,"+/").concat(t,"+|").concat(t,"+|nan.0|inf.0)i)(?=[()[\\]\\s]|$)")}function jn(e,t){return"".concat(On(e),"[+-]?").concat(t,"+")}var In=/^#\/((?:\\\/|[^/]|\[[^\]]*\/[^\]]*\])+)\/([gimyus]*)$/;var Pn="(?:[-+]?(?:[0-9]+(?:[eE][-+]?[0-9]+)|(?:\\.[0-9]+|[0-9]+\\.[0-9]+)(?:[eE][-+]?[0-9]+)?)|[0-9]+\\.)";var Nn="(?:#[ie])?(?:[+-]?(?:[0-9]+/[0-9]+|nan.0|inf.0|".concat(Pn,"|[+-]?[0-9]+))?(?:").concat(Pn,"|[+-](?:[0-9]+/[0-9]+|[0-9]+|nan.0|inf.0))i");var Rn=new RegExp("^(#[ie])?".concat(Pn,"$"),"i");function Tn(e,t){var r=e==="x"?"(?!\\+|".concat(t,")"):"(?!\\.|".concat(t,")");var n="";if(e===""){n="(?:[-+]?(?:[0-9]+(?:[eE][-+]?[0-9]+)|(?:\\.[0-9]+|[0-9]+\\.[0-9]+(?![0-9]))(?:[eE][-+]?[0-9]+)?))"}return new RegExp("^((?:(?:".concat(n,"|[-+]?inf.0|[-+]?nan.0|[+-]?").concat(t,"+/").concat(t,"+(?!").concat(t,")|[+-]?").concat(t,"+)").concat(r,")?)(").concat(n,"|[-+]?inf.0|[-+]?nan.0|[+-]?").concat(t,"+/").concat(t,"+|[+-]?").concat(t,"+|[+-])i$"),"i")}var Ln=function(){var u={};[[10,"","[0-9]"],[16,"x","[0-9a-fA-F]"],[8,"o","[0-7]"],[2,"b","[01]"]].forEach(function(e){var t=j(e,3),r=t[0],n=t[1],i=t[2];u[r]=Tn(n,i)});return u}();var Un={alarm:"",backspace:"\b",delete:"",escape:"",newline:"\n",null:"\0",return:"\r",space:" ",tab:"\t",dle:"",soh:"",dc1:"",stx:"",dc2:"",etx:"",dc3:"",eot:"",dc4:"",enq:"",nak:"",ack:"",syn:"",bel:"",etb:"",bs:"\b",can:"",ht:"\t",em:"",lf:"\n",sub:"",vt:"\v",esc:"",ff:"\f",fs:"",cr:"\r",gs:"",so:"",rs:"",si:"",us:"",del:""};function Mn(e){var t=[];var r=0;var n=e.length;while(r=55296&&i<=56319&&r1&&arguments[1]!==undefined?arguments[1]:10;var r=ei(e);var n=r.number.split("/");var i=fo({num:C([n[0],r.radix||t]),denom:C([n[1],r.radix||t])});if(r.inexact){return i.valueOf()}else{return i}}function ri(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:10;var r=ei(e);if(r.inexact){return uo(parseInt(r.number,r.radix||t))}return C([r.number,r.radix||t])}function ni(e){var t=e.match(/#\\x([0-9a-f]+)$/i);var r;if(t){var n=parseInt(t[1],16);r=String.fromCodePoint(n)}else{t=e.match(/#\\(.+)$/);if(t){r=t[1]}}if(r){return za(r)}throw new Error("Parse: invalid character")}function ii(e){var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:10;function t(e){var t;if(e==="+"){t=C(1)}else if(e==="-"){t=C(-1)}else if(e.match(Hn)){t=C([e,i])}else if(e.match(Wn)){var r=e.split("/");t=fo({num:C([r[0],i]),denom:C([r[1],i])})}else if(e.match(Rn)){var n=oi(e);if(u.exact){return n.toRational()}return n}else if(e.match(/nan.0$/)){return C(NaN)}else if(e.match(/inf.0$/)){if(e[0]==="-"){return C(Number.NEGATIVE_INFINITY)}return C(Number.POSITIVE_INFINITY)}else{throw new Error("Internal Parser Error")}if(u.inexact){return uo(t.valueOf())}return t}var u=ei(e);i=u.radix||i;var r;var n=u.number.match(Zn);if(i!==10&&n){r=n}else{r=u.number.match(Ln[i])}var a,o;o=t(r[2]);if(r[1]){a=t(r[1])}else{a=C(0)}if(o.cmp(0)===0&&o.__type__==="bigint"){return a}return io({im:o,re:a})}function ui(e){return parseInt(e.toString(),10)===e}function ai(e){var t=e.match(/^(([-+]?[0-9]*)(?:\.([0-9]+))?)e([-+]?[0-9]+)/i);if(t){var r=parseInt(t[4],10);var n;var i=t[1].replace(/[-+]?([0-9]*)\..+$/,"$1").length;var u=t[3]&&t[3].length;if(i0){return C(u).mul(o)}}}r=uo(r);if(t.exact){return r.toRational()}return r}function si(e){e=e.replace(/\\x([0-9a-f]+);/gi,function(e,t){return"\\u"+t.padStart(4,"0")}).replace(/\n/g,"\\n");var t=e.match(/(\\*)(\\x[0-9A-F])/i);if(t&&t[1].length%2===0){throw new Error("Invalid string literal, unclosed ".concat(t[2]))}try{return $a(JSON.parse(e))}catch(e){var r=e.message.replace(/in JSON /,"").replace(/.*Error: /,"");throw new Error("Invalid string literal: ".concat(r))}}function ci(e){if(e.match(/^\|.*\|$/)){e=e.replace(/(^\|)|(\|$)/g,"");var r={t:"\t",r:"\r",n:"\n"};e=e.replace(/\\(x[^;]+);/g,function(e,t){return String.fromCharCode(parseInt("0"+t,16))}).replace(/\\(.)/g,function(e,t){return r[t]||t})}return new L(e)}function fi(e){if(Mo.hasOwnProperty(e)){return Mo[e]}if(e.match(/^"[\s\S]*"$/)){return si(e)}else if(e[0]==="#"){var t=e.match(In);if(t){return new RegExp(t[1],t[2])}else if(e.match(Vn)){return ni(e)}var r=e.match(/#\\(.+)/);if(r&&Mn(r[1]).length===1){return ni(e)}}if(e.match(/[0-9a-f]|[+-]i/i)){if(e.match(Gn)){return ri(e)}else if(e.match(Rn)){return oi(e)}else if(e.match(Kn)){return ti(e)}else if(e.match(Jn)){return ii(e)}}if(e.match(/^#[iexobd]/)){throw new Error("Invalid numeric constant: "+e)}return ci(e)}function li(e){return!(["(",")","[","]"].includes(e)||Bi.names().includes(e))}function hi(e){return li(e)&&!(e.match(In)||e.match(/^"[\s\S]*"$/)||e.match(Gn)||e.match(Rn)||e.match(Jn)||e.match(Kn)||e.match(Vn)||["#t","#f","nil","true","false"].includes(e))}var pi=/"(?:\\[\S\s]|[^"])*"?/g;function _i(e){if(typeof e==="string"){var t=/([-\\^$[\]()+{}?*.|])/g;return e.replace(t,"\\$1")}return e}function di(){this.data=[]}di.prototype.push=function(e){this.data.push(e)};di.prototype.top=function(){return this.data[this.data.length-1]};di.prototype.pop=function(){return this.data.pop()};di.prototype.is_empty=function(){return!this.data.length};function vi(e){if(e instanceof $a){e=e.valueOf()}var t=new s(e,{whitespace:true});var r=[];while(true){var n=t.peek(true);if(n===Fo){break}r.push(n);t.skip()}return r}function yi(e){var t=e.token,r=F(e,sn);if(t.match(/^"[\s\S]*"$/)&&t.match(/\n/)){var n=new RegExp("^ {1,"+(e.col+1)+"}","mg");t=t.replace(n,"")}return vn({token:t},r)}function mi(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:function(){};this.fn=e;this.cont=t}mi.prototype.toString=function(){return"#"};function gi(n){return function(){for(var e=arguments.length,t=new Array(e),r=0;r1&&arguments[1]!==undefined?arguments[1]:false;if(e instanceof $a){e=e.toString()}if(t){return vi(e)}else{var r=vi(e).map(function(e){if(e.token==="#\\ "){return e.token}return e.token.trim()}).filter(function(e){return e&&!e.match(/^;/)&&!e.match(/^#\|[\s\S]*\|#$/)});return Di(r)}}function Di(e){var t=0;var r=null;var n=[];for(var i=0;i0&&arguments[0]!==undefined?arguments[0]:null;if(e instanceof L){if(e.is_gensym()){return e}e=e.valueOf()}if(xi(e)){return L(e)}if(e!==null){return r(e,Symbol("#:".concat(e)))}t++;return r(t,Symbol("#:g".concat(t)))}}();function ki(e){var r=this;var n={pending:true,rejected:false,fulfilled:false,reason:undefined,type:undefined};e=e.then(function(e){n.type=us(e);n.fulfilled=true;n.pending=false;return e});$i(this,"_promise",e,{hidden:true});if(Xu(e["catch"])){e=e["catch"](function(e){n.rejected=true;n.pending=false;n.reason=e})}Object.keys(n).forEach(function(t){Object.defineProperty(r,"__".concat(t,"__"),{enumerable:true,get:function e(){return n[t]}})});$i(this,"__promise__",e);this.then=false}ki.prototype.then=function(e){return new ki(this.valueOf().then(e))};ki.prototype["catch"]=function(e){return new ki(this.valueOf()["catch"](e))};ki.prototype.valueOf=function(){if(!this._promise){throw new Error("QuotedPromise: invalid promise created")}return this._promise};ki.prototype.toString=function(){if(this.__pending__){return ki.pending_str}if(this.__rejected__){return ki.rejected_str}return"#")};ki.pending_str="#";ki.rejected_str="#";function Ci(e){if(Array.isArray(e)){return Promise.all(Oi(e)).then(Si)}return e}function Oi(e){var t=new Array(e.length),r=e.length;while(r--){var n=e[r];if(n instanceof ki){t[r]=new Bo(n)}else{t[r]=n}}return t}function Si(e){var t=new Array(e.length),r=e.length;while(r--){var n=e[r];if(n instanceof Bo){t[r]=n.valueOf()}else{t[r]=n}}return t}var Bi={LITERAL:Symbol["for"]("literal"),SPLICE:Symbol["for"]("splice"),SYMBOL:Symbol["for"]("symbol"),names:function e(){return Object.keys(this.__list__)},type:function e(t){return this.get(t).type},get:function e(t){return this.__list__[t]},off:function e(t){var r=this;var n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;if(Array.isArray(t)){t.forEach(function(e){return r.off(e,n)})}else if(n===null){delete this.__events__[t]}else{this.__events__=this.__events__.filter(function(e){return e!==n})}},on:function e(t,r){var n=this;if(Array.isArray(t)){t.forEach(function(e){return n.on(e,r)})}else if(!this.__events__[t]){this.__events__[t]=[r]}else{this.__events__[t].push(r)}},trigger:function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i",new L("quote-promise"),Bi.LITERAL]];var Ri=Ni.map(function(e){return e[0]});Object.freeze(Ri);Object.defineProperty(Bi,"__builtins__",{writable:false,value:Ri});Ni.forEach(function(e){var t=j(e,3),r=t[0],n=t[1],i=t[2];Bi.append(r,n,i)});var s=function(){function p(e){var t=this;var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},n=r.whitespace,i=n===void 0?false:n;D(this,p);$i(this,"__input__",e.replace(/\r/g,""));var u={};["_i","_whitespace","_col","_newline","_line","_state","_next","_token","_prev_char"].forEach(function(r){Object.defineProperty(t,r,{configurable:false,enumerable:false,get:function e(){return u[r]},set:function e(t){u[r]=t}})});this._whitespace=i;this._i=this._line=this._col=this._newline=0;this._state=this._next=this._token=null;this._prev_char=""}A(p,[{key:"get",value:function e(t){return this.__internal[t]}},{key:"set",value:function e(t,r){this.__internal[t]=r}},{key:"token",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:false;if(t){var r=this._line;if(this._whitespace&&this._token==="\n"){--r}return{token:this._token,col:this._col,offset:this._i,line:r}}return this._token}},{key:"peek",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:false;if(this._i>=this.__input__.length){return Fo}if(this._token){return this.token(t)}var r=this.next_token();if(r){this._token=this.__input__.substring(this._i,this._next);return this.token(t)}return Fo}},{key:"skip",value:function e(){if(this._next!==null){this._token=null;this._i=this._next}}},{key:"read_line",value:function e(){var t=this.__input__.length;if(this._i>=t){return Fo}for(var r=this._i;r=r){return Fo}if(t+this._i>=r){return this.read_rest()}var n=this._i+t;var i=this.__input__.substring(this._i,n);var u=i.match(/\n/g);if(u){this._line+=u.length}this._i=n;return i}},{key:"peek_char",value:function e(){if(this._i>=this.__input__.length){return Fo}return za(this.__input__[this._i])}},{key:"read_char",value:function e(){var t=this.peek_char();this.skip_char();return t}},{key:"skip_char",value:function e(){if(this._i1&&arguments[1]!==undefined?arguments[1]:{},r=t.prev_char,n=t["char"],i=t.next_char;var u=j(e,4),a=u[0],o=u[1],s=u[2],f=u[3];if(e.length!==5){throw new Error("Lexer: Invalid rule of length ".concat(e.length))}if(!n.match(a)){return false}if(!Ti(o,r)){return false}if(!Ti(s,i)){return false}if(f!==this._state){return false}return true}},{key:"next_token",value:function f(){if(this._i>=this.__input__.length){return false}var e=true;e:for(var t=this._i,r=this.__input__.length;t2&&arguments[2]!==undefined?arguments[2]:null;var i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:null;if(t.length===0){throw new Error("Lexer: invalid literal rule")}if(t.length===1){return[[t,n,i,null,null]]}var u=[];for(var a=0,o=t.length;a1&&arguments[1]!==undefined?arguments[1]:{},r=t.env,n=t.meta,i=n===void 0?false:n,u=t.formatter,a=u===void 0?yi:u;D(this,o);if(e instanceof $a){e=e.toString()}$i(this,"_formatter",a,{hidden:true});$i(this,"__lexer__",new s(e));$i(this,"__env__",r);$i(this,"_meta",i,{hidden:true});$i(this,"_refs",[],{hidden:true});$i(this,"_state",{parentheses:0},{hidden:true})}A(o,[{key:"resolve",value:function e(t){return this.__env__&&this.__env__.get(t,{throwError:false})}},{key:"peek",value:function(){var e=B(z.mark(function e(){var r;return z.wrap(function e(t){while(1){switch(t.prev=t.next){case 0:r=this.__lexer__.peek(true);if(!(r===Fo)){t.next=4;break}return t.abrupt("return",Fo);case 4:if(!this.is_comment(r.token)){t.next=7;break}this.skip();return t.abrupt("continue",0);case 7:if(!(r.token==="#;")){t.next=14;break}this.skip();if(!(this.__lexer__.peek()===Fo)){t.next=11;break}throw new Error("Lexer: syntax error eof found after comment");case 11:t.next=13;return this._read_object();case 13:return t.abrupt("continue",0);case 14:return t.abrupt("break",17);case 17:r=this._formatter(r);if(!this._meta){t.next=20;break}return t.abrupt("return",r);case 20:return t.abrupt("return",r.token);case 21:case"end":return t.stop()}}},e,this)}));function t(){return e.apply(this,arguments)}return t}()},{key:"reset",value:function e(){this._refs.length=0}},{key:"skip",value:function e(){this.__lexer__.skip()}},{key:"read",value:function(){var e=B(z.mark(function e(){var r;return z.wrap(function e(t){while(1){switch(t.prev=t.next){case 0:t.next=2;return this.peek();case 2:r=t.sent;this.skip();return t.abrupt("return",r);case 5:case"end":return t.stop()}}},e,this)}));function t(){return e.apply(this,arguments)}return t}()},{key:"match_datum_label",value:function e(t){var r=t.match(/^#([0-9]+)=$/);return r&&r[1]}},{key:"match_datum_ref",value:function e(t){var r=t.match(/^#([0-9]+)#$/);return r&&r[1]}},{key:"is_open",value:function e(t){var r=["(","["].includes(t);if(r){this._state.parentheses++}return r}},{key:"is_close",value:function e(t){var r=[")","]"].includes(t);if(r){this._state.parentheses--}return r}},{key:"read_list",value:function(){var e=B(z.mark(function e(){var r,n,i,u;return z.wrap(function e(t){while(1){switch(t.prev=t.next){case 0:r=U,n=r;case 1:t.next=4;return this.peek();case 4:i=t.sent;if(!(i===Fo)){t.next=7;break}return t.abrupt("break",27);case 7:if(!this.is_close(i)){t.next=10;break}this.skip();return t.abrupt("break",27);case 10:if(!(i==="."&&r!==U)){t.next=17;break}this.skip();t.next=14;return this._read_object();case 14:n.cdr=t.sent;t.next=25;break;case 17:t.t0=M;t.next=20;return this._read_object();case 20:t.t1=t.sent;t.t2=U;u=new t.t0(t.t1,t.t2);if(r===U){r=u}else{n.cdr=u}n=u;case 25:t.next=1;break;case 27:return t.abrupt("return",r);case 28:case"end":return t.stop()}}},e,this)}));function t(){return e.apply(this,arguments)}return t}()},{key:"read_value",value:function(){var e=B(z.mark(function e(){var r;return z.wrap(function e(t){while(1){switch(t.prev=t.next){case 0:t.next=2;return this.read();case 2:r=t.sent;if(!(r===Fo)){t.next=5;break}throw new Error("Parser: Expected token eof found");case 5:return t.abrupt("return",fi(r));case 6:case"end":return t.stop()}}},e,this)}));function t(){return e.apply(this,arguments)}return t}()},{key:"is_comment",value:function e(t){return t.match(/^;/)||t.match(/^#\|/)&&t.match(/\|#$/)}},{key:"evaluate",value:function e(t){return _s(t,{env:this.__env__,error:function e(t){throw t}})}},{key:"read_object",value:function(){var e=B(z.mark(function e(){var r;return z.wrap(function e(t){while(1){switch(t.prev=t.next){case 0:this.reset();t.next=3;return this._read_object();case 3:r=t.sent;if(r instanceof Ui){r=r.valueOf()}if(!this._refs.length){t.next=7;break}return t.abrupt("return",this._resolve_object(r));case 7:return t.abrupt("return",r);case 8:case"end":return t.stop()}}},e,this)}));function t(){return e.apply(this,arguments)}return t}()},{key:"balanced",value:function e(){return this._state.parentheses===0}},{key:"ballancing_error",value:function e(t){var r=this._state.parentheses;var n=new Error("Parser: expected parenthesis but eof found");var i=new RegExp("\\){".concat(r,"}$"));n.__code__=[t.toString().replace(i,"")];throw n}},{key:"_resolve_object",value:function(){var t=B(z.mark(function e(r){var n=this;var i;return z.wrap(function e(t){while(1){switch(t.prev=t.next){case 0:if(!Array.isArray(r)){t.next=2;break}return t.abrupt("return",r.map(function(e){return n._resolve_object(e)}));case 2:if(!wu(r)){t.next=6;break}i={};Object.keys(r).forEach(function(e){i[e]=n._resolve_object(r[e])});return t.abrupt("return",i);case 6:if(!(r instanceof M)){t.next=8;break}return t.abrupt("return",this._resolve_pair(r));case 8:return t.abrupt("return",r);case 9:case"end":return t.stop()}}},e,this)}));function e(e){return t.apply(this,arguments)}return e}()},{key:"_resolve_pair",value:function(){var t=B(z.mark(function e(r){return z.wrap(function e(t){while(1){switch(t.prev=t.next){case 0:if(!(r instanceof M)){t.next=15;break}if(!(r.car instanceof Ui)){t.next=7;break}t.next=4;return r.car.valueOf();case 4:r.car=t.sent;t.next=8;break;case 7:this._resolve_pair(r.car);case 8:if(!(r.cdr instanceof Ui)){t.next=14;break}t.next=11;return r.cdr.valueOf();case 11:r.cdr=t.sent;t.next=15;break;case 14:this._resolve_pair(r.cdr);case 15:return t.abrupt("return",r);case 16:case"end":return t.stop()}}},e,this)}));function e(e){return t.apply(this,arguments)}return e}()},{key:"_read_object",value:function(){var e=B(z.mark(function e(){var r,n,i,u,a,o,s,c,f;return z.wrap(function e(t){while(1){switch(t.prev=t.next){case 0:t.next=2;return this.peek();case 2:r=t.sent;if(!(r===Fo)){t.next=5;break}return t.abrupt("return",r);case 5:if(!ji(r)){t.next=39;break}n=Bi.get(r);i=Ii(r);this.skip();t.next=11;return this._read_object();case 11:a=t.sent;if(i){t.next=26;break}o=this.__env__.get(n.symbol);if(!(typeof o==="function")){t.next=26;break}if(!Pi(r)){t.next=19;break}return t.abrupt("return",o.call(this.__env__,a));case 19:if(!(a===U)){t.next=23;break}return t.abrupt("return",o.apply(this.__env__));case 23:if(!(a instanceof M)){t.next=25;break}return t.abrupt("return",o.apply(this.__env__,a.to_array(false)));case 25:throw new Error("Parse Error: Invalid parser extension "+"invocation ".concat(n.symbol));case 26:if(Pi(r)){u=new M(n.symbol,new M(a,U))}else{u=new M(n.symbol,a)}if(!i){t.next=29;break}return t.abrupt("return",u);case 29:if(!(o instanceof Vu)){t.next=38;break}t.next=32;return this.evaluate(u);case 32:s=t.sent;if(!(s instanceof M||s instanceof L)){t.next=35;break}return t.abrupt("return",M.fromArray([L("quote"),s]));case 35:return t.abrupt("return",s);case 38:throw new Error("Parse Error: invalid parser extension: "+n.symbol);case 39:c=this.match_datum_ref(r);if(!(c!==null)){t.next=45;break}this.skip();if(!this._refs[c]){t.next=44;break}return t.abrupt("return",new Ui(c,this._refs[c]));case 44:throw new Error("Parse Error: invalid datum label #".concat(c,"#"));case 45:f=this.match_datum_label(r);if(!(f!==null)){t.next=52;break}this.skip();this._refs[f]=this._read_object();return t.abrupt("return",this._refs[f]);case 52:if(!this.is_open(r)){t.next=57;break}this.skip();return t.abrupt("return",this.read_list());case 57:return t.abrupt("return",this.read_value());case 58:case"end":return t.stop()}}},e,this)}));function t(){return e.apply(this,arguments)}return t}()}]);return o}();var Ui=function(){function r(e,t){D(this,r);this.name=e;this.data=t}A(r,[{key:"valueOf",value:function e(){return this.data}}]);return r}();function Mi(e,t){return qi.apply(this,arguments)}function qi(){qi=e(z.mark(function e(r,n){var i,u;return z.wrap(function e(t){while(1){switch(t.prev=t.next){case 0:if(!n){if(qo){n=qo.get("**interaction-environment**",{throwError:false})}else{n=Yo}}i=new Li(r,{env:n});case 2:t.next=5;return P(i.read_object());case 5:u=t.sent;if(!i.balanced()){i.ballancing_error(u)}if(!(u===Fo)){t.next=9;break}return t.abrupt("break",13);case 9:t.next=11;return u;case 11:t.next=2;break;case 13:case"end":return t.stop()}}},e)}));return qi.apply(this,arguments)}function Yi(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:function(e){return e};var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:null;if(ra(e)){var n=e.then(t);if(r===null){return n}else{return n["catch"](r)}}if(e instanceof Array){return Vi(e,t,r)}if(wu(e)){return zi(e,t,r)}return t(e)}function Vi(t,r,e){if(t.find(ra)){return Yi(Ci(t),function(e){if(Object.isFrozen(t)){Object.freeze(e)}return r(e)},e)}return r(t)}function zi(t,e,r){var i=Object.keys(t);var n=[],u=[];var a=i.length;while(a--){var o=i[a];var s=t[o];n[a]=s;if(ra(s)){u.push(s)}}if(u.length){return Yi(Ci(n),function(e){var n={};e.forEach(function(e,t){var r=i[t];n[r]=e});if(Object.isFrozen(t)){Object.freeze(n)}return n},r)}return e(t)}function $i(e,t,r){var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{},i=n.hidden,u=i===void 0?false:i;Object.defineProperty(e,t,{value:r,configurable:true,enumerable:!u})}function Ji(e){return Ki.apply(this,arguments)}function Ki(){Ki=B(z.mark(function e(r){var n,i,u,a,o,s,c;return z.wrap(function e(t){while(1){switch(t.prev=t.next){case 0:n=[];i=false;u=false;t.prev=3;o=yn(r);case 5:t.next=7;return o.next();case 7:if(!(i=!(s=t.sent).done)){t.next=13;break}c=s.value;n.push(c);case 10:i=false;t.next=5;break;case 13:t.next=19;break;case 15:t.prev=15;t.t0=t["catch"](3);u=true;a=t.t0;case 19:t.prev=19;t.prev=20;if(!(i&&o["return"]!=null)){t.next=24;break}t.next=24;return o["return"]();case 24:t.prev=24;if(!u){t.next=27;break}throw a;case 27:return t.finish(24);case 28:return t.finish(19);case 29:return t.abrupt("return",n);case 30:case"end":return t.stop()}}},e,null,[[3,15,19,29],[20,,24,28]])}));return Ki.apply(this,arguments)}function Gi(e,t){if(t instanceof RegExp){return function(e){return String(e).match(t)}}else if(Xu(t)){return t}throw new Error("Invalid matcher")}function y(e,t,r,n){if(typeof e!=="string"){t=arguments[0];r=arguments[1];n=arguments[2];e=null}if(r){if(n){t.__doc__=r}else{t.__doc__=Hi(r)}}if(e){t.__name__=e}else if(t.name&&!Ca(t)){t.__name__=t.name}return t}function Hi(e){return e.split("\n").map(function(e){return e.trim()}).join("\n")}function Wi(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;var r=e.length;if(t<=0){throw Error("previousSexp: Invalid argument sexp = ".concat(t))}e:while(t--&&r>=0){var n=1;while(n>0){var i=e[--r];if(!i){break e}if(i==="("||i.token==="("){n--}else if(i===")"||i.token===")"){n++}}r--}return e.slice(r+1)}function Qi(e){if(!e||!e.length){return 0}var t=e.length;if(e[t-1].token==="\n"){return 0}while(--t){if(e[t].token==="\n"){var r=(e[t+1]||{}).token;if(r){return r.length}}}return 0}function Zi(e,t){return f(e,t)===t.length;function f(r,n){function e(e,t){var r=hn(e),n;try{for(r.s();!(n=r.n()).done;){var i=n.value;var u=f(i,t);if(u!==-1){return u}}}catch(e){r.e(e)}finally{r.f()}return-1}function t(){return r[u]===Symbol["for"]("symbol")&&!hi(n[o])}function i(){var e=r[u+1];var t=n[o+1];if(e!==undefined&&t!==undefined){return f([e],[t])}}var u=0;var a={};for(var o=0;o0){continue}}else if(t()){return-1}}else if(r[u]instanceof Array){var c=f(r[u],n.slice(o));if(c===-1||c+o>n.length){return-1}o+=c-1;u++;continue}else{return-1}u++}if(r.length!==u){return-1}return n.length}}function Xi(e){this.__code__=e.replace(/\r/g,"")}Xi.defaults={offset:0,indent:2,exceptions:{specials:[/^(?:#:)?(?:define(?:-values|-syntax|-macro|-class|-record-type)?|(?:call-with-(?:input-file|output-file|port))|lambda|let-env|try|catch|when|unless|while|syntax-rules|(let|letrec)(-syntax|\*)?)$/],shift:{1:["&","#"]}}};Xi.match=Zi;Xi.prototype._options=function e(t){var r=Xi.defaults;if(typeof t==="undefined"){return Object.assign({},r)}var n=t&&t.exceptions||{};var i=n.specials||[];var u=n.shift||{1:[]};return vn(vn(vn({},r),t),{},{exceptions:{specials:[].concat(q(r.exceptions.specials),q(i)),shift:vn(vn({},u),{},{1:[].concat(q(r.exceptions.shift[1]),q(u[1]))})}})};Xi.prototype.indent=function e(t){var r=wi(this.__code__,true);return this._indent(r,t)};Xi.exception_shift=function(u,e){function t(e){if(!e.length){return false}if(e.indexOf(u)!==-1){return true}else{var t=e.filter(function(e){return e instanceof RegExp});if(!t.length){return false}var r=hn(t),n;try{for(r.s();!(n=r.n()).done;){var i=n.value;if(u.match(i)){return true}}}catch(e){r.e(e)}finally{r.f()}}return false}if(t(e.exceptions.specials)){return e.indent}var r=e.exceptions.shift;for(var n=0,i=Object.entries(r);n0){t.offset=0}if(n.toString()===e.toString()&&ms(n)){return t.offset+n[0].col}else if(n.length===1){return t.offset+n[0].col+1}else{var u=-1;if(i){var a=Xi.exception_shift(i.token,t);if(a!==-1){u=a}}if(u===-1){u=Xi.exception_shift(n[1].token,t)}if(u!==-1){return t.offset+n[0].col+u}else if(n[0].line3&&n[1].line===n[3].line){if(n[1].token==="("||n[1].token==="["){return t.offset+n[1].col}return t.offset+n[3].col}else if(n[0].line===n[1].line){return t.offset+t.indent+n[0].col}else{var o=n.slice(2);for(var s=0;s")};eu.prototype.match=function(e){return e.match(this.pattern)};function tu(){for(var e=arguments.length,t=new Array(e),r=0;r")};Xi.Pattern=tu;Xi.Ahead=eu;var ru=/^[[(]$/;var nu=/^[\])]$/;var iu=/[^()[\]]/;var uu=new eu(/[^)\]]/);var au=Symbol["for"]("*");var ou=new tu([ru,au,nu],[iu],"+");var su=new tu([ru,au,nu],"+");var cu=new tu([Symbol["for"]("symbol")],"?");var fu=new tu([Symbol["for"]("symbol")],"*");var lu=[ru,fu,nu];var hu=new tu([ru,Symbol["for"]("symbol"),au,nu],"+");var pu=vu("define","lambda","define-macro","syntax-rules");var _u=/^(?!.*\b(?:[()[\]]|define(?:-macro)?|let(?:\*|rec|-env|-syntax|)?|lambda|syntax-rules)\b).*$/;var du=/^(?:#:)?(let(?:\*|rec|-env|-syntax)?)$/;function vu(){for(var e=arguments.length,t=new Array(e),r=0;r0&&!i[e]){i[e]=Wi(n,e)}});var u=hn(t),p;try{for(u.s();!(p=u.n()).done;){var a=j(p.value,3),_=a[0],o=a[1],s=a[2];o=o.valueOf();var d=o>0?i[o]:n;var v=d.filter(function(e){return e.trim()&&!ji(e)});var y=h(d);var m=Zi(_,v);var g=e.slice(r).find(function(e){return e.trim()&&!ji(e)});if(m&&(s instanceof eu&&s.match(g)||!s)){var c=r-y;if(e[c]!=="\n"){if(!e[c].trim()){e[c]="\n"}else{e.splice(c,0,"\n");r++}}r+=y;continue e}}}catch(e){u.e(e)}finally{u.f()}}this.__code__=e.join("");return this};Xi.prototype._spaces=function(e){return new Array(e+1).join(" ")};Xi.prototype.format=function c(e){var t=this.__code__.replace(/[ \t]*\n[ \t]*/g,"\n ");var r=wi(t,true);var n=this._options(e);var i=0;var u=0;for(var a=0;a0&&arguments[0]!==undefined?arguments[0]:true;var n=new Map;function i(e){if(e instanceof M){if(n.has(e)){return n.get(e)}var t=new M;n.set(e,t);if(r){t.car=i(e.car)}else{t.car=e.car}t.cdr=i(e.cdr);t[ga]=e[ga];return t}return e}return i(this)};M.prototype.last_pair=function(){var e=this;while(true){if(e.cdr===U){return e}e=e.cdr}};M.prototype.to_array=function(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:true;var t=[];if(this.car instanceof M){if(e){t.push(this.car.to_array())}else{t.push(this.car)}}else{t.push(this.car.valueOf())}if(this.cdr instanceof M){t=t.concat(this.cdr.to_array())}return t};M.fromArray=function(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:true;var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;if(e instanceof M||r&&e instanceof Array&&e[ya]){return e}if(t===false){var n=U;for(var i=e.length;i--;){n=new M(e[i],n)}return n}if(e.length&&!(e instanceof Array)){e=q(e)}var u=U;var a=e.length;while(a--){var o=e[a];if(o instanceof Array){o=M.fromArray(o,t,r)}else if(typeof o==="string"){o=$a(o)}else if(typeof o==="number"&&!Number.isNaN(o)){o=C(o)}u=new M(o,u)}return u};M.prototype.to_object=function(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:false;var t=this;var r={};while(true){if(t instanceof M&&t.car instanceof M){var n=t.car;var i=n.car;if(i instanceof L){i=i.__name__}if(i instanceof $a){i=i.valueOf()}var u=n.cdr;if(u instanceof M){u=u.to_object(e)}if(ts(u)){if(!e){u=u.valueOf()}}r[i]=u;t=t.cdr}else{break}}return r};M.fromPairs=function(e){return e.reduce(function(e,t){return new M(new M(new L(t[0]),t[1]),e)},U)};M.fromObject=function(t){var e=Object.keys(t).map(function(e){return[e,t[e]]});return M.fromPairs(e)};M.prototype.reduce=function(e){var t=this;var r=U;while(true){if(t!==U){r=e(r,t.car);t=t.cdr}else{break}}return r};M.prototype.reverse=function(){if(this.haveCycles()){throw new Error("You can't reverse list that have cycles")}var e=this;var t=U;while(e!==U){var r=e.cdr;e.cdr=t;t=e;e=r}return t};M.prototype.transform=function(n){function i(e){if(e instanceof M){if(e.replace){delete e.replace;return e}var t=n(e.car);if(t instanceof M){t=i(t)}var r=n(e.cdr);if(r instanceof M){r=i(r)}return new M(t,r)}return e}return i(this)};M.prototype.map=function(e){if(typeof this.car!=="undefined"){return new M(e(this.car),this.cdr===U?U:this.cdr.map(e))}else{return U}};var bu=new Map;function wu(e){return e&&_(e)==="object"&&e.constructor===Object}var Du=Object.getOwnPropertyNames(Array.prototype);var Eu=[];Du.forEach(function(e){Eu.push(Array[e],Array.prototype[e])});function Au(e){e=sa(e);return Eu.includes(e)}function xu(e){return Xu(e)&&(Ca(e)||e.__doc__)}function Fu(r){var e=r.constructor||Object;var n=wu(r);var i=Xu(r[Symbol.asyncIterator])||Xu(r[Symbol.iterator]);var u;if(bu.has(e)){u=bu.get(e)}else{bu.forEach(function(e,t){t=sa(t);if(r.constructor===t&&(t===Object&&n&&!i||t!==Object)){u=e}})}return u}var ku=new Map;[[true,"#t"],[false,"#f"],[null,"null"],[undefined,"#"]].forEach(function(e){var t=j(e,2),r=t[0],n=t[1];ku.set(r,n)});function Cu(r){if(r&&_(r)==="object"){var n={};var e=Object.getOwnPropertySymbols(r);e.forEach(function(e){var t=e.toString().replace(/Symbol\(([^)]+)\)/,"$1");n[t]=Pu(r[e])});var t=Object.getOwnPropertyNames(r);t.forEach(function(e){var t=r[e];if(t&&_(t)==="object"&&t.constructor===Object){n[e]=Cu(t)}else{n[e]=Pu(t)}});return n}return r}function Ou(e){return Object.keys(e).concat(Object.getOwnPropertySymbols(e))}function Su(e,t){return e.hasOwnProperty(t)&&Xu(e.toString)}function Bu(e){if(Ba(e)){return"#"}var t=e.prototype&&e.prototype.constructor;if(Xu(t)&&Ca(t)){if(e[ba]&&t.hasOwnProperty("__name__")){var r=t.__name__;if($a.isString(r)){r=r.toString();return"#")}return"#"}}if(e.hasOwnProperty("__name__")){var n=e.__name__;if(_(n)==="symbol"){n=Ai(n)}if(typeof n==="string"){return"#")}}if(Su(e,"toString")){return e.toString()}else if(e.name&&!Ca(e)){return"#")}else{return"#"}}var ju=new Map;[[Error,function(e){return e.message}],[M,function(e,t){var r=t.quote,n=t.skip_cycles,i=t.pair_args;if(!n){e.markCycles()}return e.toString.apply(e,[r].concat(q(i)))}],[za,function(e,t){var r=t.quote;if(r){return e.toString()}return e.valueOf()}],[$a,function(e,t){var r=t.quote;e=e.toString();if(r){return JSON.stringify(e).replace(/\\n/g,"\n")}return e}],[RegExp,function(e){return"#"+e.toString()}]].forEach(function(e){var t=j(e,2),r=t[0],n=t[1];ju.set(r,n)});var Iu=[L,C,Vu,jo,ho,po,So,ki];function Pu(e,t,c){if(typeof jQuery!=="undefined"&&e instanceof jQuery.fn.init){return"#"}if(ku.has(e)){return ku.get(e)}if(Nu(e)){return"#"}if(e){var r=e.constructor;if(ju.has(r)){for(var n=arguments.length,f=new Array(n>3?n-3:0),i=3;i"}if(e===null){return"null"}if(_(e)==="object"){var a=e.constructor;if(!a){a=Object}var o;if(typeof a.__class__==="string"){o=a.__class__}else{var s=Fu(e);if(s){if(Xu(s)){return s(e,t)}else{throw new Error("toString: Invalid repr value")}}o=a.name}if(Xu(e.toString)&&Ca(e.toString)){return e.toString().valueOf()}if(us(e)==="instance"){if(Ca(a)&&a.__name__){o=a.__name__.valueOf()}else if(!Ba(a)){o="instance"}}if(ns(e,Symbol.iterator)){if(o){return"#")}return"#"}if(ns(e,Symbol.asyncIterator)){if(o){return"#")}return"#"}if(o!==""){return"#<"+o+">"}return"#