diff --git a/Makefile b/Makefile
index 57e1b332..f201bed5 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
.PHONY: publish test coveralls lint zero
-VERSION=1.0.0-beta.15
-VERSION_DASH=`echo -n "1.0.0-beta.15" | sed "s/-/%E2%80%93/"`
+VERSION=1.0.0-beta.16
+VERSION_DASH=`echo -n "1.0.0-beta.16" | 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 dcdef71f..26db7978 100644
--- a/README.md
+++ b/README.md
@@ -1,12 +1,12 @@
-
-[![npm](https://img.shields.io/badge/npm-1.0.0%E2%80%93beta.15-blue.svg)](https://www.npmjs.com/package/@jcubic/lips)
+[![npm](https://img.shields.io/badge/npm-1.0.0%E2%80%93beta.16-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)
-[![travis](https://travis-ci.com/jcubic/lips.svg?branch=devel&1eec8b962e54e4acd16206ac4e5cf9609e281fbd)](https://travis-ci.com/github/jcubic/lips)
-[![Coverage Status](https://coveralls.io/repos/github/jcubic/lips/badge.svg?branch=devel&17423cfd6c8eebb2ada372b7a12083bd)](https://coveralls.io/github/jcubic/lips?branch=devel)
+[![travis](https://travis-ci.com/jcubic/lips.svg?branch=master&3dd32fccc26732d8149810e51027b525647c5579)](https://travis-ci.com/github/jcubic/lips)
+[![Coverage Status](https://coveralls.io/repos/github/jcubic/lips/badge.svg?branch=master&17423cfd6c8eebb2ada372b7a12083bd)](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)
@@ -159,7 +159,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:
@@ -201,7 +201,7 @@ Because LIPS is tree walking interpreter sometimes it may be slow. Especially if
process long arrays and use callback function. If the array is quite large each pice 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 4349c676..d07dfe15 100644
--- a/dist/lips.js
+++ b/dist/lips.js
@@ -4,7 +4,7 @@
* | | \ \ | | | || . \/ __> | |
* | | > \ | |_ | || _/\__ \ | |
* | | / ^ \ |___||_||_| <___/ | |
- * \_\ /_/ \_\ /_/ v. DEV
+ * \_\ /_/ \_\ /_/ v. 1.0.0-beta.16
*
* 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: Fri, 12 Nov 2021 08:35:50 +0000
+ * build: Mon, 15 Nov 2021 19:33:52 +0000
*/
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -5003,7 +5003,7 @@
* The rationalize algorithm is by Per M.A. Bothner, Alan Bawden and Marc Feeley.
* source: Kawa, C-Gambit
*
- * Build time: Fri, 12 Nov 2021 08:35:50 +0000
+ * Build time: Mon, 15 Nov 2021 19:33:52 +0000
*/
var _excluded = ["token"],
_excluded2 = ["stderr", "stdin", "stdout", "command_line"];
@@ -18694,10 +18694,10 @@
var banner = function () {
// Rollup tree-shaking is removing the variable if it's normal string because
- // obviously 'Fri, 12 Nov 2021 08:35:50 +0000' == '{{' + 'DATE}}'; can be removed
+ // obviously 'Mon, 15 Nov 2021 19:33:52 +0000' == '{{' + 'DATE}}'; can be removed
// but disablig Tree-shaking is adding lot of not used code so we use this
// hack instead
- var date = LString('Fri, 12 Nov 2021 08:35:50 +0000').valueOf();
+ var date = LString('Mon, 15 Nov 2021 19:33:52 +0000').valueOf();
var _date = date === '{{' + 'DATE}}' ? new Date() : new Date(date);
@@ -18709,7 +18709,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 specic 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.16 (".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 specic 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
@@ -18741,9 +18741,9 @@
read_only(QuotedPromise, '__class__', 'promise'); // -------------------------------------------------------------------------
var lips = {
- version: 'DEV',
+ version: '1.0.0-beta.16',
banner: banner,
- date: 'Fri, 12 Nov 2021 08:35:50 +0000',
+ date: 'Mon, 15 Nov 2021 19:33:52 +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 6104c926..af6e3c04 100644
--- a/dist/lips.min.js
+++ b/dist/lips.min.js
@@ -4,7 +4,7 @@
* | | \ \ | | | || . \/ __> | |
* | | > \ | |_ | || _/\__ \ | |
* | | / ^ \ |___||_||_| <___/ | |
- * \_\ /_/ \_\ /_/ v. DEV
+ * \_\ /_/ \_\ /_/ v. 1.0.0-beta.16
*
* 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: Fri, 12 Nov 2021 08:35:50 +0000
+ * build: Mon, 15 Nov 2021 19:33:52 +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}});if(t)o(e,t)}function _(e){"@babel/helpers - typeof";if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"){_=function e(t){return typeof t}}else{_=function e(t){return t&&typeof Symbol==="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t}}return _(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 s(e){s=Object.setPrototypeOf?Object.getPrototypeOf:function e(t){return t.__proto__||Object.getPrototypeOf(t)};return s(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 c(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 D(e,t){if(e==null)return{};var r=w(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 E(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 A(e,t){return r(e)||E(e,t)||f(e,t)||l()}function F(e){var t;if(typeof Symbol!=="undefined"){if(Symbol.asyncIterator)t=e[Symbol.asyncIterator];if(t==null&&Symbol.iterator)t=e[Symbol.iterator]}if(t==null)t=e["@@asyncIterator"];if(t==null)t=e["@@iterator"];if(t==null)throw new TypeError("Object is not async iterable");return t.call(e)}function x(e){this.wrapped=e}function C(e){return new x(e)}function S(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 x;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}}S.prototype[typeof Symbol==="function"&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this};S.prototype.next=function(e){return this._invoke("next",e)};S.prototype["throw"]=function(e){return this._invoke("throw",e)};S.prototype["return"]=function(e){return this._invoke("return",e)};function e(e){return function(){return new S(e.apply(this,arguments))}}var B={exports:{}};(function(e){var t=function(a){var e=Object.prototype;var f=e.hasOwnProperty;var s;var t=typeof Symbol==="function"?Symbol:{};var i=t.iterator||"@@iterator";var r=t.asyncIterator||"@@asyncIterator";var n=t.toStringTag||"@@toStringTag";function u(e,t,r){Object.defineProperty(e,t,{value:r,enumerable:true,configurable:true,writable:true});return e[t]}try{u({},"")}catch(e){u=function(e,t,r){return e[t]=r}}function o(e,t,r,n){var i=t&&t.prototype instanceof c?t:c;var u=Object.create(i.prototype);var a=new O(n||[]);u._invoke=F(e,r,a);return u}a.wrap=o;function l(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}var h="suspendedStart";var p="suspendedYield";var _="executing";var d="completed";var v={};function c(){}function m(){}function y(){}var g={};u(g,i,function(){return this});var b=Object.getPrototypeOf;var w=b&&b(b(S([])));if(w&&w!==e&&f.call(w,i)){g=w}var D=y.prototype=c.prototype=Object.create(g);m.prototype=y;u(D,"constructor",y);u(y,"constructor",m);m.displayName=u(y,n,"GeneratorFunction");function E(e){["next","throw","return"].forEach(function(t){u(e,t,function(e){return this._invoke(t,e)})})}a.isGeneratorFunction=function(e){var t=typeof e==="function"&&e.constructor;return t?t===m||(t.displayName||t.name)==="GeneratorFunction":false};a.mark=function(e){if(Object.setPrototypeOf){Object.setPrototypeOf(e,y)}else{e.__proto__=y;u(e,n,"GeneratorFunction")}e.prototype=Object.create(D);return e};a.awrap=function(e){return{__await:e}};function A(o,s){function c(e,t,r,n){var i=l(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);u(A.prototype,r,function(){return this});a.AsyncIterator=A;a.async=function(e,t,r,n,i){if(i===void 0)i=Promise;var u=new A(o(e,t,r,n),i);return a.isGeneratorFunction(t)?u:u.next().then(function(e){return e.done?e.value:u.next()})};function F(a,o,s){var c=h;return function e(t,r){if(c===_){throw new Error("Generator is already running")}if(c===d){if(t==="throw"){throw r}return B()}s.method=t;s.arg=r;while(true){var n=s.delegate;if(n){var i=x(n,s);if(i){if(i===v)continue;return i}}if(s.method==="next"){s.sent=s._sent=s.arg}else if(s.method==="throw"){if(c===h){c=d;throw s.arg}s.dispatchException(s.arg)}else if(s.method==="return"){s.abrupt("return",s.arg)}c=_;var u=l(a,o,s);if(u.type==="normal"){c=s.done?d:p;if(u.arg===v){continue}return{value:u.arg,done:s.done}}else if(u.type==="throw"){c=d;s.method="throw";s.arg=u.arg}}}}function x(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;x(e,t);if(t.method==="throw"){return v}}t.method="throw";t.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var n=l(r,e.iterator,t.arg);if(n.type==="throw"){t.method="throw";t.arg=n.arg;t.delegate=null;return v}var i=n.arg;if(!i){t.method="throw";t.arg=new TypeError("iterator result is not an object");t.delegate=null;return v}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 v}E(D);u(D,n,"Generator");u(D,i,function(){return this});u(D,"toString",function(){return"[object Generator]"});function C(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 k(e){var t=e.completion||{};t.type="normal";delete t.arg;e.completion=t}function O(e){this.tryEntries=[{tryLoc:"root"}];e.forEach(C,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);k(r);return v}}},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;k(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 v}};return a}(e.exports);try{regeneratorRuntime=t}catch(e){if(typeof globalThis==="object"){globalThis.regeneratorRuntime=t}else{Function("r","regeneratorRuntime = r")(t)}}})(B);var j=B.exports;var I=typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{};var P=[];var N=[];var R=typeof Uint8Array!=="undefined"?Uint8Array:Array;var T=false;function U(){T=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 R(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=N[e.charCodeAt(t)]<<2|N[e.charCodeAt(t+1)]>>4;a[s++]=i&255}else if(u===1){i=N[e.charCodeAt(t)]<<10|N[e.charCodeAt(t+1)]<<4|N[e.charCodeAt(t+2)]>>2;a[s++]=i>>8&255;a[s++]=i&255}return a}function M(e){return P[e>>18&63]+P[e>>12&63]+P[e>>6&63]+P[e&63]}function Y(e,t,r){var n;var i=[];for(var u=t;us?s:o+a))}if(n===1){t=e[r-1];i+=P[t>>2];i+=P[t<<4&63];i+="=="}else if(n===2){t=(e[r-2]<<8)+e[r-1];i+=P[t>>10];i+=P[t>>4&63];i+=P[t<<2&63];i+="="}u.push(i);return u.join("")}function z(e,t,r,n,i){var u,a;var o=i*8-n-1;var s=(1<>1;var f=-7;var l=r?i-1:0;var h=r?-1:1;var p=e[t+l];l+=h;u=p&(1<<-f)-1;p>>=-f;f+=o;for(;f>0;u=u*256+e[t+l],l+=h,f-=8){}a=u&(1<<-f)-1;u>>=-f;f+=n;for(;f>0;a=a*256+e[t+l],l+=h,f-=8){}if(u===0){u=1-c}else if(u===s){return a?NaN:(p?-1:1)*Infinity}else{a=a+Math.pow(2,n);u=u-c}return(p?-1:1)*a*Math.pow(2,u-n)}function V(e,t,r,n,i,u){var a,o,s;var c=u*8-i-1;var f=(1<>1;var h=i===23?Math.pow(2,-24)-Math.pow(2,-77):0;var p=n?0:u-1;var _=n?1:-1;var d=t<0||t===0&&1/t<0?1:0;t=Math.abs(t);if(isNaN(t)||t===Infinity){o=isNaN(t)?1:0;a=f}else{a=Math.floor(Math.log(t)/Math.LN2);if(t*(s=Math.pow(2,-a))<1){a--;s*=2}if(a+l>=1){t+=h/s}else{t+=h*Math.pow(2,1-l)}if(t*s>=2){a++;s/=2}if(a+l>=f){o=0;a=f}else if(a+l>=1){o=(t*s-1)*Math.pow(2,i);a=a+l}else{o=t*Math.pow(2,l-1)*Math.pow(2,i);a=0}}for(;i>=8;e[r+p]=o&255,p+=_,o/=256,i-=8){}a=a<0;e[r+p]=a&255,p+=_,a/=256,c-=8){}e[r+p-_]|=d*128}var J={}.toString;var G=Array.isArray||function(e){return J.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: Fri, 12 Nov 2021 08:35:50 +0000
- */var Er=["token"],Ar=["stderr","stdin","stdout","command_line"];function Fr(i){var u=xr();return function e(){var t=s(i),r;if(u){var n=s(this).constructor;r=Reflect.construct(t,arguments,n)}else{r=t.apply(this,arguments)}return a(this,r)}}function xr(){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 Cr(t,e){var r=typeof Symbol!=="undefined"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=kr(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 kr(e,t){if(!e)return;if(typeof e==="string")return Or(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 Or(e,t)}function Or(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(!Mr()){return}var t=io.get("repr")(e);if(r===null||r instanceof RegExp&&r.test(t)){console.log(io.get("type")(e)+": "+t)}if(n){console.log(e)}}if(gu(e)){e.then(t)}else{t(e)}return e}function Mr(){return uo&&uo.get("DEBUG",{throwError:false})}function Yr(e){return e?"(?:#".concat(e,"(?:#[ie])?|#[ie]#").concat(e,")"):"(?:#[ie])?"}function $r(e,t){return"".concat(Yr(e),"[+-]?").concat(t,"+/").concat(t,"+")}function zr(e,t){return"".concat(Yr(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 Vr(e,t){return"".concat(Yr(e),"[+-]?").concat(t,"+")}var Jr=/^#\/((?:\\\/|[^/]|\[[^\]]*\/[^\]]*\])+)\/([gimyus]*)$/;var Gr="(?:[-+]?(?:[0-9]+(?:[eE][-+]?[0-9]+)|(?:\\.[0-9]+|[0-9]+\\.[0-9]+)(?:[eE][-+]?[0-9]+)?)|[0-9]+\\.)";var Hr="(?:#[ie])?(?:[+-]?(?:[0-9]+/[0-9]+|nan.0|inf.0|".concat(Gr,"|[+-]?[0-9]+))?(?:").concat(Gr,"|[+-](?:[0-9]+/[0-9]+|[0-9]+|nan.0|inf.0))i");var Wr=new RegExp("^(#[ie])?".concat(Gr,"$"),"i");function Qr(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 Zr=function(){var u={};[[10,"","[0-9]"],[16,"x","[0-9a-fA-F]"],[8,"o","[0-7]"],[2,"b","[01]"]].forEach(function(e){var t=A(e,3),r=t[0],n=t[1],i=t[2];u[r]=Qr(n,i)});return u}();var Kr={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 Xr(e){var t=[];var r=0;var n=e.length;while(r=55296&&i<=56319&&r1&&arguments[1]!==undefined?arguments[1]:10;var r=_n(e);var n=r.number.split("/");var i=ka({num:da([n[0],r.radix||t]),denom:da([n[1],r.radix||t])});if(r.inexact){return i.valueOf()}else{return i}}function vn(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:10;var r=_n(e);if(r.inexact){return Ea(parseInt(r.number,r.radix||t))}return da([r.number,r.radix||t])}function mn(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 oa(r)}throw new Error("Parse: invalid character")}function yn(e){var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:10;function t(e){var t;if(e==="+"){t=da(1)}else if(e==="-"){t=da(-1)}else if(e.match(cn)){t=da([e,i])}else if(e.match(fn)){var r=e.split("/");t=ka({num:da([r[0],i]),denom:da([r[1],i])})}else if(e.match(Wr)){var n=wn(e);if(u.exact){return n.toRational()}return n}else if(e.match(/nan.0$/)){return da(NaN)}else if(e.match(/inf.0$/)){if(e[0]==="-"){return da(Number.NEGATIVE_INFINITY)}return da(Number.POSITIVE_INFINITY)}else{throw new Error("Internal Parser Error")}if(u.inexact){return Ea(t.valueOf())}return t}var u=_n(e);i=u.radix||i;var r;var n=u.number.match(hn);if(i!==10&&n){r=n}else{r=u.number.match(Zr[i])}var a,o;o=t(r[2]);if(r[1]){a=t(r[1])}else{a=da(0)}if(o.cmp(0)===0&&o.__type__==="bigint"){return a}return Da({im:o,re:a})}function gn(e){return parseInt(e.toString(),10)===e}function bn(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 da(u).mul(o)}}}r=Ea(r);if(t.exact){return r.toRational()}return r}function Dn(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 sa(JSON.parse(e))}catch(e){throw new Error("Invalid string literal")}}function En(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 Ln(e)}function An(e){if(no.hasOwnProperty(e)){return no[e]}if(e.match(/^"[\s\S]*"$/)){return Dn(e)}else if(e[0]==="#"){var t=e.match(Jr);if(t){return new RegExp(t[1],t[2])}else if(e.match(rn)){return mn(e)}var r=e.match(/#\\(.+)/);if(r&&Xr(r[1]).length===1){return mn(e)}}if(e.match(/[0-9a-f]|[+-]i/i)){if(e.match(sn)){return vn(e)}else if(e.match(Wr)){return wn(e)}else if(e.match(on)){return dn(e)}else if(e.match(an)){return yn(e)}}if(e.match(/^#[iexobd]/)){throw new Error("Invalid numeric constant: "+e)}return En(e)}function Fn(e){return!(["(",")","[","]"].includes(e)||Jn.names().includes(e))}function xn(e){return Fn(e)&&!(e.match(Jr)||e.match(/^"[\s\S]*"$/)||e.match(sn)||e.match(Wr)||e.match(an)||e.match(on)||e.match(rn)||["#t","#f","nil","true","false"].includes(e))}var Cn=/"(?:\\[\S\s]|[^"])*"?/g;function kn(e){if(typeof e==="string"){var t=/([-\\^$[\]()+{}?*.|])/g;return e.replace(t,"\\$1")}return e}function On(){this.data=[]}On.prototype.push=function(e){this.data.push(e)};On.prototype.top=function(){return this.data[this.data.length-1]};On.prototype.pop=function(){return this.data.pop()};On.prototype.is_empty=function(){return!this.data.length};function Sn(e){if(e instanceof sa){e=e.valueOf()}var t=new Zn(e,{whitespace:true});var r=[];while(true){var n=t.peek(true);if(n===$a){break}r.push(n);t.skip()}return r}function Bn(e){var t=e.token,r=D(e,Er);if(t.match(/^"[\s\S]*"$/)&&t.match(/\n/)){var n=new RegExp("^ {1,"+(e.col+1)+"}","mg");t=t.replace(n,"")}return Br({token:t},r)}function jn(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:function(){};this.fn=e;this.cont=t}jn.prototype.toString=function(){return"#"};function In(n){return function(){for(var e=arguments.length,t=new Array(e),r=0;r1&&arguments[1]!==undefined?arguments[1]:false;if(e instanceof sa){e=e.toString()}if(t){return Sn(e)}else{var r=Sn(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 Rn(r)}}function Rn(e){var t=0;var r=null;var n=[];for(var i=0;i0&&arguments[0]!==undefined?arguments[0]:null;if(e instanceof Ln){if(e.is_gensym()){return e}e=e.valueOf()}if(qn(e)){return Ln(e)}if(e!==null){return r(e,Symbol("#:".concat(e)))}t++;return r(t,Symbol("#:g".concat(t)))}}();function Yn(e){var r=this;var n={pending:true,rejected:false,fulfilled:false,reason:undefined,type:undefined};e=e.then(function(e){n.type=Ao(e);n.fulfilled=true;n.pending=false;return e});ai(this,"_promise",e,{hidden:true});if(vu(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]}})});ai(this,"__promise__",e);this.then=false}Yn.prototype.then=function(e){return new Yn(this.valueOf().then(e))};Yn.prototype["catch"]=function(e){return new Yn(this.valueOf()["catch"](e))};Yn.prototype.valueOf=function(){if(!this._promise){throw new Error("QuotedPromise: invalid promise created")}return this._promise};Yn.prototype.toString=function(){if(this.__pending__){return Yn.pending_str}if(this.__rejected__){return Yn.rejected_str}return"#")};Yn.pending_str="#";Yn.rejected_str="#";function $n(e){if(Array.isArray(e)){return Promise.all(zn(e)).then(Vn)}return e}function zn(e){var t=new Array(e.length),r=e.length;while(r--){var n=e[r];if(n instanceof Yn){t[r]=new Ha(n)}else{t[r]=n}}return t}function Vn(e){var t=new Array(e.length),r=e.length;while(r--){var n=e[r];if(n instanceof Ha){t[r]=n.valueOf()}else{t[r]=n}}return t}var Jn={LITERAL:Symbol["for"]("literal"),SPLICE:Symbol["for"]("splice"),SYMBOL:Symbol["for"]("symbol"),names:function e(){return Object.keys(this._specials)},type:function e(t){return this.get(t).type},get:function e(t){return this._specials[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 Ln("quote-promise"),Jn.LITERAL]];Object.defineProperty(Jn,"builtin",{writable:false,value:Qn.map(function(e){return e[0]})});Qn.forEach(function(e){var t=A(e,3),r=t[0],n=t[1],i=t[2];Jn.append(r,n,i)});var Zn=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;y(this,p);ai(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=""}b(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 $a}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 $a}},{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 $a}for(var r=this._i;r=r){return $a}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 $a}return oa(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]:{},n=r.prev_char,i=r["char"],u=r.next_char;var a=A(t,4),o=a[0],s=a[1],c=a[2],f=a[3];if(t.length!==5){throw new Error("Lexer: Invald rule of length ".concat(t.length))}if(!i.match(o)){return false}if(!Kn(s,n)){return false}if(!Kn(c,u)){return false}if(f!==this._state){return false}return true}},{key:"next_token",value:function e(){if(this._i>=this.__input__.length){return false}var t=true;e:for(var r=this._i,n=this.__input__.length;r2&&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?Bn:u;y(this,o);if(e instanceof sa){e=e.toString()}ai(this,"_formatter",a,{hidden:true});ai(this,"__lexer__",new Zn(e));ai(this,"__env__",r);ai(this,"_meta",i,{hidden:true});ai(this,"_refs",[],{hidden:true});ai(this,"_state",{parentheses:0},{hidden:true})}b(o,[{key:"resolve",value:function e(t){return this.__env__&&this.__env__.get(t,{throwError:false})}},{key:"peek",value:function(){var e=O(j.mark(function e(){var r;return j.wrap(function e(t){while(1){switch(t.prev=t.next){case 0:r=this.__lexer__.peek(true);if(!(r===$a)){t.next=4;break}return t.abrupt("return",$a);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()===$a)){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=O(j.mark(function e(){var r;return j.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=O(j.mark(function e(){var r,n,i,u;return j.wrap(function e(t){while(1){switch(t.prev=t.next){case 0:r=Pi,n=r;case 1:t.next=4;return this.peek();case 4:i=t.sent;if(!(i===$a)){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!==Pi)){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=Ni;t.next=20;return this._read_object();case 20:t.t1=t.sent;t.t2=Pi;u=new t.t0(t.t1,t.t2);if(r===Pi){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=O(j.mark(function e(){var r;return j.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===$a)){t.next=5;break}throw new Error("Parser: Expected token eof found");case 5:return t.abrupt("return",An(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 Io(t,{env:this.__env__,error:function e(t){throw t}})}},{key:"read_object",value:function(){var e=O(j.mark(function e(){var r;return j.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 ei){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:"ballanced",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=O(j.mark(function e(r){var n=this;var i;return j.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(!Li(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 Ni)){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=O(j.mark(function e(r){return j.wrap(function e(t){while(1){switch(t.prev=t.next){case 0:if(!(r instanceof Ni)){t.next=15;break}if(!(r.car instanceof ei)){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 ei)){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=O(j.mark(function e(){var r,n,i,u,a,o,s,c,f;return j.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===$a)){t.next=5;break}return t.abrupt("return",r);case 5:if(!Gn(r)){t.next=35;break}n=Jn.get(r);i=Hn(r);this.skip();t.next=11;return this._read_object();case 11:a=t.sent;if(i){t.next=22;break}o=this.__env__.get(n.symbol);if(!(typeof o==="function")){t.next=22;break}if(!Wn(r)){t.next=19;break}return t.abrupt("return",o.call(this.__env__,a));case 19:if(!(a instanceof Ni)){t.next=21;break}return t.abrupt("return",o.apply(this.__env__,a.to_array(false)));case 21:throw new Error("Parse Error: Invalid parser extension "+"invocation ".concat(n.symbol));case 22:if(Wn(r)){u=new Ni(n.symbol,new Ni(a,Pi))}else{u=new Ni(n.symbol,a)}if(!i){t.next=25;break}return t.abrupt("return",u);case 25:if(!(o instanceof au)){t.next=34;break}t.next=28;return this.evaluate(u);case 28:s=t.sent;if(!(s instanceof Ni||s instanceof Ln)){t.next=31;break}return t.abrupt("return",Ni.fromArray([Ln("quote"),s]));case 31:return t.abrupt("return",s);case 34:throw new Error("Parse Error: invlid parser extension: "+n.symbol);case 35:c=this.match_datum_ref(r);if(!(c!==null)){t.next=41;break}this.skip();if(!this._refs[c]){t.next=40;break}return t.abrupt("return",new ei(c,this._refs[c]));case 40:throw new Error("Parse Error: invalid datum label #".concat(c,"#"));case 41:f=this.match_datum_label(r);if(!(f!==null)){t.next=48;break}this.skip();this._refs[f]=this._read_object();return t.abrupt("return",this._refs[f]);case 48:if(!this.is_open(r)){t.next=53;break}this.skip();return t.abrupt("return",this.read_list());case 53:return t.abrupt("return",this.read_value());case 54:case"end":return t.stop()}}},e,this)}));function t(){return e.apply(this,arguments)}return t}()}]);return o}();var ei=function(){function r(e,t){y(this,r);this.name=e;this.data=t}b(r,[{key:"valueOf",value:function e(){return this.data}}]);return r}();function ti(e,t){return ri.apply(this,arguments)}function ri(){ri=e(j.mark(function e(r,n){var i,u;return j.wrap(function e(t){while(1){switch(t.prev=t.next){case 0:if(!n){if(io){n=io.get("**interaction-environment**",{throwError:false})}else{n=uo}}i=new Xn(r,{env:n});case 2:t.next=5;return C(i.read_object());case 5:u=t.sent;if(!i.ballanced()){i.ballancing_error(u)}if(!(u===$a)){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 ri.apply(this,arguments)}function ni(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(gu(e)){var n=e.then(t);if(r===null){return n}else{return n["catch"](r)}}if(e instanceof Array){return ii(e,t,r)}if(Li(e)){return ui(e,t,r)}return t(e)}function ii(t,r,e){if(t.find(gu)){return ni($n(t),function(e){if(Object.isFrozen(t)){Object.freeze(e)}return r(e)},e)}return r(t)}function ui(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(gu(s)){u.push(s)}}if(u.length){return ni($n(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 ai(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 oi(r){var n,i,u,a,o,s,c;return j.async(function e(t){while(1){switch(t.prev=t.next){case 0:n=[];i=false;u=false;t.prev=3;o=F(r);case 5:t.next=7;return j.awrap(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 j.awrap(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()}}},null,null,[[3,15,19,29],[20,,24,28]],Promise)}function si(e,t){if(t instanceof RegExp){return function(e){return String(e).match(t)}}else if(vu(t)){return t}throw new Error("Invalid matcher")}function ci(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__=fi(r)}}if(e){t.__name__=e}else if(t.name&&!Vu(t)){t.__name__=t.name}return t}function fi(e){return e.split("\n").map(function(e){return e.trim()}).join("\n")}function li(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 hi(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 pi(e,t){return f(e,t)===t.length;function f(r,n){function e(e,t){var r=Cr(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")&&!xn(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 _i(e){this.__code__=e.replace(/\r/g,"")}_i.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:["&","#"]}}};_i.match=pi;_i.prototype._options=function e(t){var r=_i.defaults;if(typeof t==="undefined"){return Object.assign({},r)}var n=t&&t.exceptions||{};var i=n.specials||[];var u=n.shift||{1:[]};return Br(Br(Br({},r),t),{},{exceptions:{specials:[].concat(k(r.exceptions.specials),k(i)),shift:Br(Br({},u),{},{1:[].concat(k(r.exceptions.shift[1]),k(u[1]))})}})};_i.prototype.indent=function e(t){var r=Nn(this.__code__,true);return this._indent(r,t)};_i.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=Cr(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){n.offset=0}if(u.toString()===t.toString()&&To(u)){return n.offset+u[0].col}else if(u.length===1){return n.offset+u[0].col+1}else{var s=-1;if(a){var c=_i.exception_shift(a.token,n);if(c!==-1){s=c}}if(s===-1){s=_i.exception_shift(u[1].token,n)}if(s!==-1){return n.offset+u[0].col+s}else if(u[0].line3&&u[1].line===u[3].line){if(u[1].token==="("||u[1].token==="["){return n.offset+u[1].col}return n.offset+u[3].col}else if(u[0].line===u[1].line){return n.offset+n.indent+u[0].col}else{var f=u.slice(2);for(var l=0;l")};di.prototype.match=function(e){return e.match(this.pattern)};function vi(){for(var e=arguments.length,t=new Array(e),r=0;r")};_i.Pattern=vi;_i.Ahead=di;var mi=/^[[(]$/;var yi=/^[\])]$/;var gi=/[^()[\]]/;var bi=new di(/[^)\]]/);var wi=Symbol["for"]("*");var Di=new vi([mi,wi,yi],[gi],"+");var Ei=new vi([mi,wi,yi],"+");var Ai=new vi([Symbol["for"]("symbol")],"?");var Fi=new vi([Symbol["for"]("symbol")],"*");var xi=[mi,Fi,yi];var Ci=new vi([mi,Symbol["for"]("symbol"),wi,yi],"+");var ki=Bi("define","lambda","define-macro","syntax-rules");var Oi=/^(?!.*\b(?:[()[\]]|define(?:-macro)?|let(?:\*|rec|-env|-syntax|)?|lambda|syntax-rules)\b).*$/;var Si=/^(?:#:)?(let(?:\*|rec|-env|-syntax)?)$/;function Bi(){for(var e=arguments.length,t=new Array(e),r=0;r0&&!o[e]){o[e]=li(a,e)}});var s=Cr(i),c;try{for(s.s();!(c=s.n()).done;){var f=A(c.value,3),l=f[0],h=f[1],p=f[2];h=h.valueOf();var _=h>0?o[h]:a;var d=_.filter(function(e){return e.trim()&&!Gn(e)});var v=r(_);var m=pi(l,d);var y=n.slice(u).find(function(e){return e.trim()&&!Gn(e)});if(m&&(p instanceof di&&p.match(y)||!p)){var g=u-v;if(n[g]!=="\n"){if(!n[g].trim()){n[g]="\n"}else{n.splice(g,0,"\n");u++}}u+=v;continue e}}}catch(e){s.e(e)}finally{s.f()}}this.__code__=n.join("");return this};_i.prototype._spaces=function(e){return new Array(e+1).join(" ")};_i.prototype.format=function e(t){var r=this.__code__.replace(/[ \t]*\n[ \t]*/g,"\n ");var n=Nn(r,true);var i=this._options(t);var u=0;var a=0;for(var o=0;o0&&arguments[0]!==undefined?arguments[0]:true;var n=new Map;function i(e){if(e instanceof Ni){if(n.has(e)){return n.get(e)}var t=new Ni;n.set(e,t);if(r){t.car=i(e.car)}else{t.car=e.car}t.cdr=i(e.cdr);t[Ru]=e[Ru];return t}return e}return i(this)};Ni.prototype.last_pair=function(){var e=this;while(true){if(e.cdr===Pi){return e}e=e.cdr}};Ni.prototype.to_array=function(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:true;var t=[];if(this.car instanceof Ni){if(e){t.push(this.car.to_array())}else{t.push(this.car)}}else{t.push(this.car.valueOf())}if(this.cdr instanceof Ni){t=t.concat(this.cdr.to_array())}return t};Ni.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 Ni||r&&e instanceof Array&&e[Pu]){return e}if(t===false){var n=Pi;for(var i=e.length;i--;){n=new Ni(e[i],n)}return n}if(e.length&&!(e instanceof Array)){e=k(e)}var u=Pi;var a=e.length;while(a--){var o=e[a];if(o instanceof Array){o=Ni.fromArray(o,t,r)}else if(typeof o==="string"){o=sa(o)}else if(typeof o==="number"&&!Number.isNaN(o)){o=da(o)}u=new Ni(o,u)}return u};Ni.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 Ni&&t.car instanceof Ni){var n=t.car;var i=n.car;if(i instanceof Ln){i=i.__name__}if(i instanceof sa){i=i.valueOf()}var u=n.cdr;if(u instanceof Ni){u=u.to_object(e)}if(bo(u)){if(!e){u=u.valueOf()}}r[i]=u;t=t.cdr}else{break}}return r};Ni.fromPairs=function(e){return e.reduce(function(e,t){return new Ni(new Ni(new Ln(t[0]),t[1]),e)},Pi)};Ni.fromObject=function(t){var e=Object.keys(t).map(function(e){return[e,t[e]]});return Ni.fromPairs(e)};Ni.prototype.reduce=function(e){var t=this;var r=Pi;while(true){if(t!==Pi){r=e(r,t.car);t=t.cdr}else{break}}return r};Ni.prototype.reverse=function(){if(this.haveCycles()){throw new Error("You can't reverse list that have cycles")}var e=this;var t=Pi;while(e!==Pi){var r=e.cdr;e.cdr=t;t=e;e=r}return t};Ni.prototype.transform=function(n){function i(e){if(e instanceof Ni){if(e.replace){delete e.replace;return e}var t=n(e.car);if(t instanceof Ni){t=i(t)}var r=n(e.cdr);if(r instanceof Ni){r=i(r)}return new Ni(t,r)}return e}return i(this)};Ni.prototype.map=function(e){if(typeof this.car!=="undefined"){return new Ni(e(this.car),this.cdr===Pi?Pi:this.cdr.map(e))}else{return Pi}};var Ti=new Map;function Li(e){return e&&_(e)==="object"&&e.constructor===Object}var Ui=Object.getOwnPropertyNames(Array.prototype);var qi=[];Ui.forEach(function(e){qi.push(Array[e],Array.prototype[e])});function Mi(e){e=Fu(e);return qi.includes(e)}function Yi(e){return vu(e)&&(Vu(e)||e.__doc__)}function $i(r){var e=r.constructor||Object;var n=Li(r);var i=vu(r[Symbol.asyncIterator])||vu(r[Symbol.iterator]);var u;if(Ti.has(e)){u=Ti.get(e)}else{Ti.forEach(function(e,t){t=Fu(t);if(r.constructor===t&&(t===Object&&n&&!i||t!==Object)){u=e}})}return u}var zi=new Map;[[true,"#t"],[false,"#f"],[null,"null"],[undefined,"#"]].forEach(function(e){var t=A(e,2),r=t[0],n=t[1];zi.set(r,n)});function Vi(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]=Zi(r[e])});var t=Object.getOwnPropertyNames(r);t.forEach(function(e){var t=r[e];if(t&&_(t)==="object"&&t.constructor===Object){n[e]=Vi(t)}else{n[e]=Zi(t)}});return n}return r}function Ji(e){return Object.keys(e).concat(Object.getOwnPropertySymbols(e))}function Gi(e,t){return e.hasOwnProperty(t)&&vu(e.toString)}function Hi(e){if(Hu(e)){return"#"}var t=e.prototype&&e.prototype.constructor;if(vu(t)&&Vu(t)){if(e[Tu]&&t.hasOwnProperty("__name__")){var r=t.__name__;if(sa.isString(r)){r=r.toString();return"#")}return"#"}}if(e.hasOwnProperty("__name__")){var n=e.__name__;if(_(n)==="symbol"){n=Un(n)}if(typeof n==="string"){return"#")}}if(Gi(e,"toString")){return e.toString()}else if(e.name&&!Vu(e)){return"#")}else{return"#"}}var Wi=new Map;[[Error,function(e){return e.message}],[Ni,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(k(i)))}],[oa,function(e,t){var r=t.quote;if(r){return e.toString()}return e.valueOf()}],[sa,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=A(e,2),r=t[0],n=t[1];Wi.set(r,n)});var Qi=[Ln,da,au,Wa,Sa,Ba,Ga,Yn];function Zi(e,t,r){if(typeof jQuery!=="undefined"&&e instanceof jQuery.fn.init){return"#"}if(zi.has(e)){return zi.get(e)}if(Ki(e)){return"#"}if(e){var n=e.constructor;if(Wi.has(n)){for(var i=arguments.length,u=new Array(i>3?i-3:0),a=3;a"}if(e===null){return"null"}if(_(e)==="object"){var f=e.constructor;if(!f){f=Object}var l;if(typeof f.__class__==="string"){l=f.__class__}else{var h=$i(e);if(h){if(vu(h)){return h(e,t)}else{throw new Error("toString: Invalid repr value")}}l=f.name}if(vu(e.toString)&&Vu(e.toString)){return e.toString().valueOf()}if(Ao(e)==="instance"){if(Vu(f)&&f.__name__){l=f.__name__.valueOf()}else if(!Hu(f)){l="instance"}}if(Do(e,Symbol.iterator)){if(l){return"#")}return"#"}if(Do(e,Symbol.asyncIterator)){if(l){return"#")}return"#"}if(l!==""){return"#<"+l+">"}return"#