diff --git a/Makefile b/Makefile
index 91974171..1c25c64a 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
.PHONY: publish test coveralls lint zero
-VERSION=1.0.0-beta.10
-VERSION_DASH=`echo -n "1.0.0-beta.10" | sed "s/-/%E2%80%93/"`
+VERSION=1.0.0-beta.11
+VERSION_DASH=`echo -n "1.0.0-beta.11" | 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 0846f595..19afdd4f 100644
--- a/README.md
+++ b/README.md
@@ -1,14 +1,14 @@
-![LIPS - Scheme Based Powerful Lisp Language](https://github.com/jcubic/lips/blob/devel/assets/lips.svg?raw=true)
+![LIPS - Scheme Based Powerful Lisp Language](https://github.com/jcubic/lips/blob/master/assets/lips.svg?raw=true)
-[![npm](https://img.shields.io/badge/npm-1.0.0%E2%80%93beta.10-blue.svg)](https://www.npmjs.com/package/@jcubic/lips)
+[![npm](https://img.shields.io/badge/npm-1.0.0%E2%80%93beta.11-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.org/jcubic/lips.svg?branch=devel&592e2c94549a753d0ccd154aaaa27dc1ca901d17)](https://travis-ci.org/jcubic/lips)
-[![Coverage Status](https://coveralls.io/repos/github/jcubic/lips/badge.svg?branch=devel&9c6e0aba32c2372d70056c5f57c2311a)](https://coveralls.io/github/jcubic/lips?branch=devel)
+[![travis](https://travis-ci.org/jcubic/lips.svg?branch=master&e90dcac3b5fcfcd4c1fade75f9cf3aded52bacd5)](https://travis-ci.org/jcubic/lips)
+[![Coverage Status](https://coveralls.io/repos/github/jcubic/lips/badge.svg?branch=master&83772d306416614a34e010475a6264c0)](https://coveralls.io/github/jcubic/lips?branch=master)
[![Join Gitter Chat](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/jcubic/lips)
[![GitHub license](https://img.shields.io/github/license/jcubic/lips.svg)](https://github.com/jcubic/lips/blob/master/LICENSE)
[![GitHub stars](https://img.shields.io/github/stars/jcubic/lips.svg?style=social&label=Star&maxAge=2592000)](https://GitHub.com/jcubic/lips/stargazers/)
-
+
![NPM Download Count](https://img.shields.io/npm/dm/@jcubic/lips)
![JSDelivr Download count](https://img.shields.io/jsdelivr/npm/hm/@jcubic/lips)
@@ -196,7 +196,7 @@ npm install -g @jcubic/lips
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:
diff --git a/dist/lips.js b/dist/lips.js
index 77f75a89..6e909ba0 100644
--- a/dist/lips.js
+++ b/dist/lips.js
@@ -4,7 +4,7 @@
* | | \ \ | | | || . \/ __> | |
* | | > \ | |_ | || _/\__ \ | |
* | | / ^ \ |___||_||_| <___/ | |
- * \_\ /_/ \_\ /_/ v. DEV
+ * \_\ /_/ \_\ /_/ v. 1.0.0-beta.11
*
* 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: Mon, 18 Jan 2021 14:58:43 +0000
+ * build: Sun, 31 Jan 2021 11:47:57 +0000
*/
(function () {
'use strict';
@@ -13034,10 +13034,10 @@
var banner = function () {
// Rollup tree-shaking is removing the variable if it's normal string because
- // obviously 'Mon, 18 Jan 2021 14:58:43 +0000' == '{{' + 'DATE}}'; can be removed
+ // obviously 'Sun, 31 Jan 2021 11:47:57 +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('Mon, 18 Jan 2021 14:58:43 +0000').valueOf();
+ var date = LString('Sun, 31 Jan 2021 11:47:57 +0000').valueOf();
var _date = date === '{{' + 'DATE}}' ? new Date() : new Date(date);
@@ -13049,7 +13049,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.\nYou can also use (help name) to display help for specic function or macro and\n(apropos name) to display list of matched names in environment.\n").replace(/^.*\n/, '');
+ var banner = "\n __ __ __\n / / \\ \\ _ _ ___ ___ \\ \\\n| | \\ \\ | | | || . \\/ __> | |\n| | > \\ | |_ | || _/\\__ \\ | |\n| | / ^ \\ |___||_||_| <___/ | |\n \\_\\ /_/ \\_\\ /_/\n\nLIPS Interpreter 1.0.0-beta.11 (".concat(_build, ") \nCopyright (c) 2018-").concat(_year, " Jakub T. Jankiewicz\n\nType (env) to see environment with functions macros and variables.\nYou can also use (help name) to display help for specic function or macro and\n(apropos name) to display list of matched names in environment.\n").replace(/^.*\n/, '');
return banner;
}(); // -------------------------------------------------------------------------
// to be used with string function when code is minified
@@ -13072,9 +13072,9 @@
LString.__class__ = 'string'; // -------------------------------------------------------------------------
var lips = {
- version: 'DEV',
+ version: '1.0.0-beta.11',
banner: banner,
- date: 'Mon, 18 Jan 2021 14:58:43 +0000',
+ date: 'Sun, 31 Jan 2021 11:47:57 +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 213c2e56..c776a015 100644
--- a/dist/lips.min.js
+++ b/dist/lips.min.js
@@ -4,7 +4,7 @@
* | | \ \ | | | || . \/ __> | |
* | | > \ | |_ | || _/\__ \ | |
* | | / ^ \ |___||_||_| <___/ | |
- * \_\ /_/ \_\ /_/ v. DEV
+ * \_\ /_/ \_\ /_/ v. 1.0.0-beta.11
*
* LIPS is Pretty Simple - Scheme based Powerful LISP in JavaScript
*
@@ -31,6 +31,6 @@
* Copyright (c) 2014-present, Facebook, Inc.
* released under MIT license
*
- * build: Mon, 18 Jan 2021 14:58:43 +0000
+ * build: Sun, 31 Jan 2021 11:47:57 +0000
*/
-(function(){"use strict";function _readOnlyError(e){throw new Error('"'+e+'" is read-only')}var readOnlyError=_readOnlyError;function createCommonjsModule(e,r){return r={exports:{}},e(r,r.exports),r.exports}var setPrototypeOf=createCommonjsModule(function(n){function t(e,r){n.exports=t=Object.setPrototypeOf||function e(r,n){r.__proto__=n;return r};return t(e,r)}n.exports=t});function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Date.prototype.toString.call(Reflect.construct(Date,[],function(){}));return true}catch(e){return false}}var isNativeReflectConstruct=_isNativeReflectConstruct;var construct=createCommonjsModule(function(t){function i(e,r,n){if(isNativeReflectConstruct()){t.exports=i=Reflect.construct}else{t.exports=i=function e(r,n,t){var i=[null];i.push.apply(i,n);var a=Function.bind.apply(r,i);var u=new a;if(t)setPrototypeOf(u,t.prototype);return u}}return i.apply(null,arguments)}t.exports=i});function _arrayWithHoles(e){if(Array.isArray(e))return e}var arrayWithHoles=_arrayWithHoles;function _iterableToArray(e){if(typeof Symbol!=="undefined"&&Symbol.iterator in Object(e))return Array.from(e)}var iterableToArray=_iterableToArray;function _arrayLikeToArray(e,r){if(r==null||r>e.length)r=e.length;for(var n=0,t=new Array(r);n=0;--r){var i=this.tryEntries[r];var a=i.completion;if(i.tryLoc==="root"){return e("end")}if(i.tryLoc<=this.prev){var u=l.call(i,"catchLoc");var o=l.call(i,"finallyLoc");if(u&&o){if(this.prev=0;--n){var t=this.tryEntries[n];if(t.tryLoc<=this.prev&&l.call(t,"finallyLoc")&&this.prev=0;--r){var n=this.tryEntries[r];if(n.finallyLoc===e){this.complete(n.completion,n.afterLoc);S(n);return m}}},catch:function(e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc===e){var t=n.completion;if(t.type==="throw"){var i=t.arg;S(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){this.delegate={iterator:k(e),resultName:r,nextLoc:n};if(this.method==="next"){this.arg=c}return m}};return u}(e.exports);try{regeneratorRuntime=r}catch(e){Function("r","regeneratorRuntime = r")(r)}});var regenerator=runtime_1;function asyncGeneratorStep(e,r,n,t,i,a,u){try{var o=e[a](u);var c=o.value}catch(e){n(e);return}if(o.done){r(c)}else{Promise.resolve(c).then(t,i)}}function _asyncToGenerator(o){return function(){var e=this,u=arguments;return new Promise(function(r,n){var t=o.apply(e,u);function i(e){asyncGeneratorStep(t,r,n,i,a,"next",e)}function a(e){asyncGeneratorStep(t,r,n,i,a,"throw",e)}i(undefined)})}}var asyncToGenerator=_asyncToGenerator;function _classCallCheck(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}var classCallCheck=_classCallCheck;function _defineProperties(e,r){for(var n=0;n=0)continue;n[i]=e[i]}return n}var objectWithoutPropertiesLoose=_objectWithoutPropertiesLoose;function _objectWithoutProperties(e,r){if(e==null)return{};var n=objectWithoutPropertiesLoose(e,r);var t,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0)continue;if(!Object.prototype.propertyIsEnumerable.call(e,t))continue;n[t]=e[t]}}return n}var objectWithoutProperties=_objectWithoutProperties;function _iterableToArrayLimit(e,r){if(typeof Symbol==="undefined"||!(Symbol.iterator in Object(e)))return;var n=[];var t=true;var i=false;var a=undefined;try{for(var u=e[Symbol.iterator](),o;!(t=(o=u.next()).done);t=true){n.push(o.value);if(r&&n.length===r)break}}catch(e){i=true;a=e}finally{try{if(!t&&u["return"]!=null)u["return"]()}finally{if(i)throw a}}return n}var iterableToArrayLimit=_iterableToArrayLimit;function _slicedToArray(e,r){return arrayWithHoles(e)||iterableToArrayLimit(e,r)||unsupportedIterableToArray(e,r)||nonIterableRest()}var slicedToArray=_slicedToArray;var _typeof_1=createCommonjsModule(function(r){function n(e){"@babel/helpers - typeof";if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"){r.exports=n=function e(r){return typeof r}}else{r.exports=n=function e(r){return r&&typeof Symbol==="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r}}return n(e)}r.exports=n});function _asyncIterator(e){var r;if(typeof Symbol!=="undefined"){if(Symbol.asyncIterator){r=e[Symbol.asyncIterator];if(r!=null)return r.call(e)}if(Symbol.iterator){r=e[Symbol.iterator];if(r!=null)return r.call(e)}}throw new TypeError("Object is not async iterable")}var asyncIterator=_asyncIterator;function _AwaitValue(e){this.wrapped=e}var AwaitValue=_AwaitValue;function _awaitAsyncGenerator(e){return new AwaitValue(e)}var awaitAsyncGenerator=_awaitAsyncGenerator;function AsyncGenerator(a){var u,o;function e(t,i){return new Promise(function(e,r){var n={key:t,arg:i,resolve:e,reject:r,next:null};if(o){o=o.next=n}else{u=o=n;c(t,i)}})}function c(r,e){try{var n=a[r](e);var t=n.value;var i=t instanceof AwaitValue;Promise.resolve(i?t.wrapped:t).then(function(e){if(i){c(r==="return"?"return":"next",e);return}s(n.done?"return":"normal",e)},function(e){c("throw",e)})}catch(e){s("throw",e)}}function s(e,r){switch(e){case"return":u.resolve({value:r,done:true});break;case"throw":u.reject(r);break;default:u.resolve({value:r,done:false});break}u=u.next;if(u){c(u.key,u.arg)}else{o=null}}this._invoke=e;if(typeof a["return"]!=="function"){this["return"]=undefined}}if(typeof Symbol==="function"&&Symbol.asyncIterator){AsyncGenerator.prototype[Symbol.asyncIterator]=function(){return this}}AsyncGenerator.prototype.next=function(e){return this._invoke("next",e)};AsyncGenerator.prototype["throw"]=function(e){return this._invoke("throw",e)};AsyncGenerator.prototype["return"]=function(e){return this._invoke("return",e)};var AsyncGenerator_1=AsyncGenerator;function _wrapAsyncGenerator(e){return function(){return new AsyncGenerator_1(e.apply(this,arguments))}}var wrapAsyncGenerator=_wrapAsyncGenerator;function _createForOfIteratorHelper(r,e){var n;if(typeof Symbol==="undefined"||r[Symbol.iterator]==null){if(Array.isArray(r)||(n=_unsupportedIterableToArray$1(r))||e&&r&&typeof r.length==="number"){if(n)r=n;var t=0;var i=function e(){};return{s:i,n:function e(){if(t>=r.length)return{done:true};return{done:false,value:r[t++]}},e:function e(r){throw r},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 a=true,u=false,o;return{s:function e(){n=r[Symbol.iterator]()},n:function e(){var r=n.next();a=r.done;return r},e:function e(r){u=true;o=r},f:function e(){try{if(!a&&n["return"]!=null)n["return"]()}finally{if(u)throw o}}}}function _unsupportedIterableToArray$1(e,r){if(!e)return;if(typeof e==="string")return _arrayLikeToArray$1(e,r);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor)n=e.constructor.name;if(n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray$1(e,r)}function _arrayLikeToArray$1(e,r){if(r==null||r>e.length)r=e.length;for(var n=0,t=new Array(r);n1&&arguments[1]!==undefined$1?arguments[1]:null;var t=arguments[1]===true;function r(e){if(!is_debug()){return}var r=global_env.get("repr")(e);if(n===null||n instanceof RegExp&&n.test(r)){console.log(global_env.get("type")(e)+": "+r)}if(t){console.log(e)}}if(is_promise(e)){e.then(r)}else{r(e)}return e}function is_debug(){return user_env.get("DEBUG",{throwError:false})}if(!root.fetch){root.fetch=function(i,a){a=a||{};return new Promise(function(e,r){var n=new XMLHttpRequest;n.open(a.method||"get",i,true);for(var t in a.headers){n.setRequestHeader(t,a.headers[t])}n.withCredentials=a.credentials=="include";n.onload=function(){e(o())};n.onerror=r;n.send(a.body||null);function o(){var t=[],i=[],a={},u;n.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(e,r,n){t.push(r=r.toLowerCase());i.push([r,n]);u=a[r];a[r]=u?"".concat(u,",").concat(n):n});return{ok:(n.status/100|0)==2,status:n.status,statusText:n.statusText,url:n.responseURL,clone:o,text:function e(){return Promise.resolve(n.responseText)},json:function e(){return Promise.resolve(n.responseText).then(JSON.parse)},blob:function e(){return Promise.resolve(new Blob([n.response]))},headers:{keys:function e(){return t},entries:function e(){return i},get:function e(r){return a[r.toLowerCase()]},has:function e(r){return r.toLowerCase()in a}}}}})}}function num_mnemicic_re(e){return e?"(?:#".concat(e,"(?:#[ie])?|#[ie]#").concat(e,")"):"(?:#[ie])?"}function gen_rational_re(e,r){return"".concat(num_mnemicic_re(e),"[+-]?").concat(r,"+/").concat(r,"+")}function gen_complex_re(e,r){return"".concat(num_mnemicic_re(e),"(?:[+-]?(?:").concat(r,"+/").concat(r,"+|").concat(r,"+))?(?:[+-]i|[+-]?(?:").concat(r,"+/").concat(r,"+|").concat(r,"+)i)(?=[()[\\]\\s]|$)")}function gen_integer_re(e,r){return"".concat(num_mnemicic_re(e),"[+-]?").concat(r,"+")}var re_re=/^#\/((?:\\\/|[^/]|\[[^\]]*\/[^\]]*\])+)\/([gimyus]*)$/;var float_stre="(?:[-+]?(?:[0-9]+(?:[eE][-+]?[0-9]+)|(?:\\.[0-9]+|[0-9]+\\.[0-9]+)(?:[eE][-+]?[0-9]+)?)|[0-9]+\\.)";var complex_float_stre="(?:#[ie])?(?:[+-]?(?:[0-9]+/[0-9]+|".concat(float_stre,"|[+-]?[0-9]+))?(?:").concat(float_stre,"|[+-](?:[0-9]+/[0-9]+|[0-9]+))i");var float_re=new RegExp("^(#[ie])?".concat(float_stre,"$"),"i");function make_complex_match_re(e,r){var n=e==="x"?"(?!\\+|".concat(r,")"):"(?!\\.|".concat(r,")");var t="";if(e===""){t="(?:[-+]?(?:[0-9]+(?:[eE][-+]?[0-9]+)|(?:\\.[0-9]+|[0-9]+\\.[0-9]+(?![0-9]))(?:[eE][-+]?[0-9]+)?))"}return new RegExp("^((?:(?:".concat(t,"|[+-]?").concat(r,"+/").concat(r,"+(?!").concat(r,")|[+-]?").concat(r,"+)").concat(n,")?)(").concat(t,"|[+-]?").concat(r,"+/").concat(r,"+|[+-]?").concat(r,"+|[+-])i$"),"i")}var complex_list_re=function(){var a={};[[10,"","[0-9]"],[16,"x","[0-9a-fA-F]"],[8,"o","[0-7]"],[2,"b","[01]"]].forEach(function(e){var r=slicedToArray(e,3),n=r[0],t=r[1],i=r[2];a[n]=make_complex_match_re(t,i)});return a}();var characters={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 ucs2decode(e){var r=[];var n=0;var t=e.length;while(n=55296&&i<=56319&&n1&&arguments[1]!==undefined$1?arguments[1]:10;var n=num_pre_parse(e);var t=n.number.split("/");var i=LRational({num:LNumber([t[0],n.radix||r]),denom:LNumber([t[1],n.radix||r])});if(n.inexact){return i.valueOf()}else{return i}}function parse_integer(e){var r=arguments.length>1&&arguments[1]!==undefined$1?arguments[1]:10;var n=num_pre_parse(e);if(n.inexact){return LFloat(parseInt(n.number,n.radix||r))}return LNumber([n.number,n.radix||r])}function parse_character(e){var r=e.match(/#\\x([0-9a-f]+)$/i);var n;if(r){var t=parseInt(r[1],16);n=String.fromCodePoint(t)}else{r=e.match(/#\\(.+)$/);if(r){n=r[1]}}if(n){return LCharacter(n)}throw new Error("Parse: invalid character")}function parse_complex(e){var i=arguments.length>1&&arguments[1]!==undefined$1?arguments[1]:10;function r(e){var r;if(e==="+"){r=LNumber(1)}else if(e==="-"){r=LNumber(-1)}else if(e.match(int_bare_re)){r=LNumber([e,i])}else if(e.match(rational_bare_re)){var n=e.split("/");r=LRational({num:LNumber([n[0],i]),denom:LNumber([n[1],i])})}else if(e.match(float_re)){var t=parse_float(e);if(a.exact){return t.toRational()}return t}else{throw new Error("Internal Parser Error")}if(a.inexact){return LFloat(r.valueOf())}return r}var a=num_pre_parse(e);i=a.radix||i;var n;var t=a.number.match(complex_bare_match_re);if(i!==10&&t){n=t}else{n=a.number.match(complex_list_re[i])}var u,o;o=r(n[2]);if(n[1]){u=r(n[1])}else if(o instanceof LFloat){u=LFloat(0)}else{u=LNumber(0)}return LComplex({im:o,re:u})}function is_int(e){return parseInt(e.toString(),10)===e}function parse_big_int(e){var r=e.match(/^(([-+]?[0-9]*)(?:\.([0-9]+))?)e([-+]?[0-9]+)/i);if(r){var n=parseInt(r[4],10);var t;var i=r[1].replace(/[-+]?([0-9]*)\..+$/,"$1").length;var a=r[3]&&r[3].length;if(i0){return LNumber(a).mul(o)}}}n=LFloat(n);if(r.exact){return n.toRational()}return n}function parse_string(e){e=e.replace(/\\x([0-9a-f]+);/gi,function(e,r){return"\\u"+r.padStart(4,"0")}).replace(/\n/g,"\\n");var r=e.match(/(\\*)(\\x[0-9A-F])/i);if(r&&r[1].length%2===0){throw new Error("Invalid string literal, unclosed ".concat(r[2]))}try{return LString(JSON.parse(e))}catch(e){throw new Error("Invalid string literal")}}function parse_symbol(e){if(e.match(/^\|.*\|$/)){e=e.replace(/(^\|)|(\|$)/g,"");var n={t:"\t",r:"\r",n:"\n"};e=e.replace(/\\(x[^;]+);/g,function(e,r){return String.fromCharCode(parseInt("0"+r,16))}).replace(/\\(.)/g,function(e,r){return n[r]||r})}return new LSymbol(e)}function parse_argument(e){var r=e.match(re_re);if(r){return new RegExp(r[1],r[2])}else if(e.match(/^"[\s\S]*"$/)){return parse_string(e)}else if(e.match(char_re)){return parse_character(e)}else if(e.match(rational_re)){return parse_rational(e)}else if(e.match(complex_re)){return parse_complex(e)}else if(e.match(int_re)){return parse_integer(e)}else if(e.match(float_re)){return parse_float(e)}else if(e==="nil"){return nil}else if(["true","#t","#true"].includes(e)){return true}else if(["false","#f","#false"].includes(e)){return false}else if(e.match(/^#[iexobd]/)){throw new Error("Invalid numeric constant")}else{var n=e.match(/#\\(.+)/);if(n&&ucs2decode(n[1]).length===1){return parse_character(e)}return parse_symbol(e)}}function is_symbol_string(e){return!(["(",")"].includes(e)||e.match(re_re)||e.match(/^"[\s\S]*"$/)||e.match(int_re)||e.match(float_re)||e.match(complex_re)||e.match(rational_re)||e.match(char_re)||["#t","#f","nil","true","false"].includes(e))}var string_re=/"(?:\\[\S\s]|[^"])*"?/g;function Stack(){this.data=[]}Stack.prototype.push=function(e){this.data.push(e)};Stack.prototype.top=function(){return this.data[this.data.length-1]};Stack.prototype.pop=function(){return this.data.pop()};Stack.prototype.is_empty=function(){return!this.data.length};function tokens(e){if(e instanceof LString){e=e.valueOf()}var r=new Lexer(e,{whitespace:true});var n=[];while(true){var t=r.peek(true);if(t===eof){break}n.push(t);r.skip()}return n}function multiline_formatter(e){var r=e.token,n=objectWithoutProperties(e,["token"]);if(r.match(/^"[\s\S]*"$/)&&r.match(/\n/)){var t=new RegExp("^ {1,"+(e.col+1)+"}","mg");r=r.replace(t,"")}return _objectSpread({token:r},n)}function Thunk(e){var r=arguments.length>1&&arguments[1]!==undefined$1?arguments[1]:function(){};this.fn=e;this.cont=r}Thunk.prototype.toString=function(){return"#"};function trampoline(t){return function(){for(var e=arguments.length,r=new Array(e),n=0;n1&&arguments[1]!==undefined$1?arguments[1]:false;if(e instanceof LString){e=e.toString()}if(r){return tokens(e)}else{var n=tokens(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 strip_s_comments(n)}}function strip_s_comments(e){var r=0;var n=null;var t=[];for(var i=0;i0&&arguments[0]!==undefined$1?arguments[0]:null;if(e instanceof LSymbol){e=e.valueOf()}if(is_gensym(e)){return LSymbol(e)}if(e!==null){return new LSymbol(Symbol("#:".concat(e)))}r++;return new LSymbol(Symbol("#:g".concat(r)))}}();function QuotedPromise(e){e["catch"](function(){});this.__promise__=e}QuotedPromise.prototype.then=function(e){return new QuotedPromise(this.__promise__.then(e))};QuotedPromise.prototype["catch"]=function(e){return new QuotedPromise(this.__promise__["catch"](e))};QuotedPromise.prototype.valueOf=function(){return this.__promise__};var specials={LITERAL:Symbol["for"]("literal"),SPLICE:Symbol["for"]("splice"),SYMBOL:Symbol["for"]("symbol"),names:function e(){return Object.keys(this._specials)},type:function e(r){return this.get(r).type},get:function e(r){return this._specials[r]},off:function e(r){var n=this;var t=arguments.length>1&&arguments[1]!==undefined$1?arguments[1]:null;if(Array.isArray(r)){r.forEach(function(e){return n.off(e,t)})}else if(t===null){delete this._events[r]}else{this._events=this._events.filter(function(e){return e!==t})}},on:function e(r,n){var t=this;if(Array.isArray(r)){r.forEach(function(e){return t.on(e,n)})}else if(!this._events[r]){this._events[r]=[n]}else{this._events[r].push(n)}},trigger:function e(r){for(var n=arguments.length,t=new Array(n>1?n-1:0),i=1;i",new LSymbol("quote-promise"),specials.LITERAL]];Object.defineProperty(specials,"builtin",{writable:false,value:defined_specials.map(function(e){return e[0]})});defined_specials.forEach(function(e){var r=slicedToArray(e,3),n=r[0],t=r[1],i=r[2];specials.append(n,t,i)});var Lexer=function(){function _(e){var r=this;var n=arguments.length>1&&arguments[1]!==undefined$1?arguments[1]:{},t=n.whitespace,i=t===void 0?false:t;classCallCheck(this,_);Object.defineProperty(this,"__input__",{value:e.replace(/\r/g,""),enumerable:true});var a={};["_i","_whitespace","_col","_newline","_line","_state","_next","_token","_prev_char"].forEach(function(n){Object.defineProperty(r,n,{configurable:false,enumerable:false,get:function e(){return a[n]},set:function e(r){a[n]=r}})});this._whitespace=i;this._i=this._line=this._col=this._newline=0;this._state=this._next=this._token=null;this._prev_char=""}createClass(_,[{key:"get",value:function e(r){return this.__internal[r]}},{key:"set",value:function e(r,n){this.__internal[r]=n}},{key:"token",value:function e(){var r=arguments.length>0&&arguments[0]!==undefined$1?arguments[0]:false;if(r){var n=this._line;if(this._whitespace&&this._token==="\n"){--n}return{token:this._token,col:this._col,offset:this._i,line:n}}return this._token}},{key:"peek",value:function e(){var r=arguments.length>0&&arguments[0]!==undefined$1?arguments[0]:false;if(this._i>=this.__input__.length){return eof}if(this._token){return this.token(r)}var n=this.next_token();if(n){this._token=this.__input__.substring(this._i,this._next);return this.token(r)}return eof}},{key:"skip",value:function e(){if(this._next!==null){this._token=null;this._i=this._next}}},{key:"read_line",value:function e(){var r=this.__input__.length;if(this._i>=r){return eof}for(var n=this._i;n=n){return eof}if(r+this._i>=n){return this.read_rest()}var t=this._i+r;var i=this.__input__.substring(this._i,t);var a=i.match(/\n/g);if(a){this._line+=a.length}this._i=t;return i}},{key:"peek_char",value:function e(){if(this._i>=this.__input__.length){return eof}return LCharacter(this.__input__[this._i])}},{key:"read_char",value:function e(){var r=this.peek_char();this.skip_char();return r}},{key:"skip_char",value:function e(){if(this._i1&&arguments[1]!==undefined$1?arguments[1]:{},t=n.prev_char,i=n["char"],a=n.next_char;var u=slicedToArray(r,4),o=u[0],c=u[1],s=u[2],l=u[3];if(r.length!==5){throw new Error("Lexer: Invald rule of length ".concat(r.length))}if(!i.match(o)){return false}if(!match_or_null(c,t)){return false}if(!match_or_null(s,a)){return false}if(l!==this._state){return false}return true}},{key:"next_token",value:function e(){if(this._i>=this.__input__.length){return false}var r=true;e:for(var n=this._i,t=this.__input__.length;n2&&arguments[2]!==undefined$1?arguments[2]:null;var i=arguments.length>3&&arguments[3]!==undefined$1?arguments[3]:null;if(r.length===0){throw new Error("Lexer: invalid literal rule")}if(r.length===1){return[[r,t,i,null,null]]}var a=[];for(var u=0,o=r.length;u1&&arguments[1]!==undefined$1?arguments[1]:{},n=r.env,t=r.meta,i=t===void 0?false:t,a=r.formatter,u=a===void 0?multiline_formatter:a;classCallCheck(this,o);if(e instanceof LString){e=e.toString()}this._formatter=u;this._meta=i;this.__lexer__=new Lexer(e);this.__env__=n}createClass(o,[{key:"resolve",value:function e(r){return this.__env__&&this.__env__.get(r,{throwError:false})}},{key:"peek",value:function(){var e=asyncToGenerator(regenerator.mark(function e(){var n;return regenerator.wrap(function e(r){while(1){switch(r.prev=r.next){case 0:n=this.__lexer__.peek(true);if(!(n===eof)){r.next=4;break}return r.abrupt("return",eof);case 4:if(!this.is_comment(n.token)){r.next=7;break}this.skip();return r.abrupt("continue",0);case 7:if(!(n.token==="#;")){r.next=14;break}this.skip();if(!(this.__lexer__.peek()===eof)){r.next=11;break}throw new Error("Lexer: syntax error eof found after comment");case 11:r.next=13;return this.read_object();case 13:return r.abrupt("continue",0);case 14:return r.abrupt("break",17);case 17:n=this._formatter(n);if(!this._meta){r.next=20;break}return r.abrupt("return",n);case 20:return r.abrupt("return",n.token);case 21:case"end":return r.stop()}}},e,this)}));function r(){return e.apply(this,arguments)}return r}()},{key:"skip",value:function e(){this.__lexer__.skip()}},{key:"special",value:function e(r){return specials.names().includes(r)}},{key:"builtin",value:function e(r){return specials.builtin.includes(r)}},{key:"read",value:function(){var e=asyncToGenerator(regenerator.mark(function e(){var n;return regenerator.wrap(function e(r){while(1){switch(r.prev=r.next){case 0:r.next=2;return this.peek();case 2:n=r.sent;this.skip();return r.abrupt("return",n);case 5:case"end":return r.stop()}}},e,this)}));function r(){return e.apply(this,arguments)}return r}()},{key:"is_open",value:function e(r){return["(","["].includes(r)}},{key:"is_close",value:function e(r){return[")","]"].includes(r)}},{key:"read_list",value:function(){var e=asyncToGenerator(regenerator.mark(function e(){var n,t,i,a;return regenerator.wrap(function e(r){while(1){switch(r.prev=r.next){case 0:n=nil,t=n;case 1:r.next=4;return this.peek();case 4:i=r.sent;if(!(i===eof)){r.next=7;break}return r.abrupt("break",27);case 7:if(!this.is_close(i)){r.next=10;break}this.skip();return r.abrupt("break",27);case 10:if(!(i==="."&&n!==nil)){r.next=17;break}this.skip();r.next=14;return this.read_object();case 14:t.cdr=r.sent;r.next=25;break;case 17:r.t0=Pair;r.next=20;return this.read_object();case 20:r.t1=r.sent;r.t2=nil;a=new r.t0(r.t1,r.t2);if(n===nil){n=a}else{t.cdr=a}t=a;case 25:r.next=1;break;case 27:return r.abrupt("return",n);case 28:case"end":return r.stop()}}},e,this)}));function r(){return e.apply(this,arguments)}return r}()},{key:"read_value",value:function(){var e=asyncToGenerator(regenerator.mark(function e(){var n;return regenerator.wrap(function e(r){while(1){switch(r.prev=r.next){case 0:r.next=2;return this.read();case 2:n=r.sent;if(!(n===eof)){r.next=5;break}throw new Error("Parser: Expected token eof found");case 5:return r.abrupt("return",parse_argument(n));case 6:case"end":return r.stop()}}},e,this)}));function r(){return e.apply(this,arguments)}return r}()},{key:"is_comment",value:function e(r){return r.match(/^;/)||r.match(/^#\|/)&&r.match(/\|#$/)}},{key:"_eval",value:function e(r){return evaluate(r,{env:this.__env__,error:function e(r){throw r}})}},{key:"read_object",value:function(){var e=asyncToGenerator(regenerator.mark(function e(){var n,t,i,a,u,o,c;return regenerator.wrap(function e(r){while(1){switch(r.prev=r.next){case 0:r.next=2;return this.peek();case 2:n=r.sent;if(!(n===eof)){r.next=5;break}return r.abrupt("return",n);case 5:if(!this.special(n)){r.next=35;break}t=specials.get(n);i=this.builtin(n);this.skip();r.next=11;return this.read_object();case 11:u=r.sent;if(i){r.next=22;break}o=this.__env__.get(t.symbol);if(!(typeof o==="function")){r.next=22;break}if(!is_literal(n)){r.next=19;break}return r.abrupt("return",o.call(this.__env__,u));case 19:if(!(u instanceof Pair)){r.next=21;break}return r.abrupt("return",o.apply(this.__env__,u.toArray(false)));case 21:throw new Error("Parser: Invalid parser extension "+"invocation ".concat(t.symbol));case 22:if(is_literal(n)){a=new Pair(t.symbol,new Pair(u,nil))}else{a=new Pair(t.symbol,u)}if(!i){r.next=25;break}return r.abrupt("return",a);case 25:if(!(o instanceof Macro)){r.next=34;break}r.next=28;return this._eval(a);case 28:c=r.sent;if(!(c instanceof Pair||c instanceof LSymbol)){r.next=31;break}return r.abrupt("return",Pair.fromArray([LSymbol("quote"),c]));case 31:return r.abrupt("return",c);case 34:throw new Error("Parser: invlid parser extension: ".concat(t.symbol));case 35:if(!this.is_open(n)){r.next=42;break}this.skip();r.next=39;return this.read_list();case 39:return r.abrupt("return",r.sent);case 42:r.next=44;return this.read_value();case 44:return r.abrupt("return",r.sent);case 45:case"end":return r.stop()}}},e,this)}));function r(){return e.apply(this,arguments)}return r}()}]);return o}();function parse(e,r){return _parse.apply(this,arguments)}function _parse(){_parse=wrapAsyncGenerator(regenerator.mark(function e(n,t){var i,a;return regenerator.wrap(function e(r){while(1){switch(r.prev=r.next){case 0:if(!t){if(global_env){t=global_env.get("**interaction-environment**",{throwError:false})}else{t=user_env}}i=new Parser(n,{env:t});case 2:r.next=5;return awaitAsyncGenerator(i.read_object());case 5:a=r.sent;if(!(a===eof)){r.next=8;break}return r.abrupt("break",12);case 8:r.next=10;return a;case 10:r.next=2;break;case 12:case"end":return r.stop()}}},e)}));return _parse.apply(this,arguments)}function unpromise(r){var e=arguments.length>1&&arguments[1]!==undefined$1?arguments[1]:function(e){return e};var n=arguments.length>2&&arguments[2]!==undefined$1?arguments[2]:null;if(r instanceof Array){var t=r.filter(is_promise);if(t.length){return unpromise(Promise.all(r),function(e){if(Object.isFrozen(r)){Object.freeze(e)}return e},n)}return e(r)}if(is_plain_object(r)){var i=Object.keys(r);var a=i.map(function(e){return r[e]});var u=a.filter(is_promise);if(u.length){return unpromise(Promise.all(a),function(e){var t={};e.forEach(function(e,r){var n=i[r];t[n]=e});if(Object.isFrozen(r)){Object.freeze(t)}return t},n)}}if(is_promise(r)){var o=r.then(e);if(n===null){return o}else{return o["catch"](n)}}return e(r)}function uniterate_async(e){return _uniterate_async.apply(this,arguments)}function _uniterate_async(){_uniterate_async=asyncToGenerator(regenerator.mark(function e(n){var t,i,a,u,o,c,s,l;return regenerator.wrap(function e(r){while(1){switch(r.prev=r.next){case 0:t=[];i=true;a=false;r.prev=3;o=asyncIterator(n);case 5:r.next=7;return o.next();case 7:c=r.sent;i=c.done;r.next=11;return c.value;case 11:s=r.sent;if(i){r.next=18;break}l=s;t.push(l);case 15:i=true;r.next=5;break;case 18:r.next=24;break;case 20:r.prev=20;r.t0=r["catch"](3);a=true;u=r.t0;case 24:r.prev=24;r.prev=25;if(!(!i&&o["return"]!=null)){r.next=29;break}r.next=29;return o["return"]();case 29:r.prev=29;if(!a){r.next=32;break}throw u;case 32:return r.finish(29);case 33:return r.finish(24);case 34:return r.abrupt("return",t);case 35:case"end":return r.stop()}}},e,null,[[3,20,24,34],[25,,29,33]])}));return _uniterate_async.apply(this,arguments)}function matcher(e,r){if(r instanceof RegExp){return function(e){return String(e).match(r)}}else if(is_function(r)){return r}}function doc(e,r,n,t){if(typeof e!=="string"){r=arguments[0];n=arguments[1];t=arguments[2];e=null}if(n){if(t){r.__doc__=n}else{r.__doc__=trim_lines(n)}}if(e){r.__name__=e}else if(r.name&&!r[__lambda__]){r.__name__=r.name}return r}function trim_lines(e){return e.split("\n").map(function(e){return e.trim()}).join("\n")}function previousSexp(e){var r=arguments.length>1&&arguments[1]!==undefined$1?arguments[1]:1;var n=e.length;if(r<=0){throw Error("previousSexp: Invalid argument sexp = ".concat(r))}e:while(r--&&n>=0){var t=1;while(t>0){var i=e[--n];if(!i){break e}if(i==="("||i.token==="("){t--}else if(i===")"||i.token===")"){t++}}n--}return e.slice(n+1)}function lineIndent(e){if(!e||!e.length){return 0}var r=e.length;if(e[r-1].token==="\n"){return 0}while(--r){if(e[r].token==="\n"){var n=(e[r+1]||{}).token;if(n){return n.length}}}return 0}function nested_pattern(e){return e instanceof Array||e instanceof Pattern}function match(e,r){return f(e,r)===r.length;function f(n,t){function e(){if(a<=0&&o<=0){return false}var e=n[a-1];if(!nested_pattern(e)){e=[e]}var r=n[a+1];if(r&&!nested_pattern(r)){r=[r]}return match(e,[t[o-1]])&&(!r||match(r,[t[o]]))}function r(){return n[a]===Symbol["for"]("symbol")&&!is_symbol_string(t[o])}function i(){var e=n[a+1];var r=t[o+1];if(e!==undefined$1&&r!==undefined$1){return f([e],[r])}}var a=0;var u={};for(var o=0;o0){continue}}else if(r()){return-1}}else if(n[a]instanceof Array){var l=f(n[a],t.slice(o));if(l===-1||l+o>t.length){return-1}o+=l-1;a++;continue}else{return-1}a++}if(n.length!==a){return-1}return t.length}}function Formatter(e){this.__code__=e.replace(/\r/g,"")}Formatter.defaults={offset:0,indent:2,exceptions:{specials:[/^(?:#:)?(?:define(?:-values|-syntax|-macro)?|lambda|let*|let-env|try|catch|when|unless|while|syntax-rules|(let|letrec)(-syntax))$/],shift:{1:["&","#"]}}};Formatter.match=match;Formatter.prototype._options=function e(r){var n=Formatter.defaults;if(typeof r==="undefined"){return Object.assign({},n)}var t=r&&r.exceptions||{};var i=t.specials||[];var a=t.shift||{1:[]};return _objectSpread(_objectSpread(_objectSpread({},n),r),{},{exceptions:{specials:[].concat(toConsumableArray(n.exceptions.specials),toConsumableArray(i)),shift:_objectSpread(_objectSpread({},a),{},{1:[].concat(toConsumableArray(n.exceptions.shift[1]),toConsumableArray(a[1]))})}})};Formatter.prototype.indent=function e(r){var n=tokenize(this.__code__,true);return this._indent(n,r)};Formatter.exception_shift=function(a,e){function r(e){if(!e.length){return false}if(e.indexOf(a)!==-1){return true}else{var r=e.filter(function(e){return e instanceof RegExp});if(!r.length){return false}var n=_createForOfIteratorHelper(r),t;try{for(n.s();!(t=n.n()).done;){var i=t.value;if(a.match(i)){return true}}}catch(e){n.e(e)}finally{n.f()}}return false}if(r(e.exceptions.specials)){return e.indent}var n=e.exceptions.shift;for(var t=0,i=Object.entries(n);t0){t.offset=0}if(a.toString()===r.toString()&&balanced(a)){return t.offset+a[0].col}else if(a.length===1){return t.offset+a[0].col+1}else{var c=-1;if(u){var s=Formatter.exception_shift(u.token,t);if(s!==-1){c=s}}if(c===-1){c=Formatter.exception_shift(a[1].token,t)}if(c!==-1){return t.offset+a[0].col+c}else if(a[0].line3&&a[1].line===a[3].line){if(a[1].token==="("||a[1].token==="["){return t.offset+a[1].col}return t.offset+a[3].col}else if(a[0].line===a[1].line){return t.offset+t.indent+a[0].col}else{var l=a.slice(2);for(var f=0;f")};Ahead.prototype.match=function(e){return e.match(this.pattern)};function Pattern(e,r){this.pattern=e;this.flag=r}Pattern.prototype.toString=function(){return"#")};Formatter.Pattern=Pattern;Formatter.Ahead=Ahead;var p_o=/[[(]/;var p_e=/[\])]/;var not_p=/[^()[\]]/;var not_close=new Ahead(/[^)\]]/);var open=new Ahead(/[([]/);var glob=Symbol["for"]("*");var sexp=new Pattern([p_o,glob,p_e],"+");var symbol=new Pattern([Symbol["for"]("symbol")],"?");var symbols=new Pattern([Symbol["for"]("symbol")],"*");var identifiers=[p_o,symbols,p_e];var let_value=new Pattern([p_o,Symbol["for"]("symbol"),glob,p_e],"+");var def_lambda_re=keywords_re("define","lambda","syntax-rules");var non_def=/^(?!.*\b(?:[()[\]]|define|let(?:\*|rec|-env|-syntax)?|lambda|syntax-rules)\b).*$/;var let_re=/^(?:#:)?(let(?:\*|rec|-env|-syntax)?)$/;function keywords_re(){for(var e=arguments.length,r=new Array(e),n=0;n0&&arguments[0]!==undefined$1?arguments[0]:true;var r=[];if(this.car instanceof Pair){if(e){r.push(this.car.toArray())}else{r.push(this.car)}}else{r.push(this.car.valueOf())}if(this.cdr instanceof Pair){r=r.concat(this.cdr.toArray())}return r};Pair.fromArray=function(e){var r=arguments.length>1&&arguments[1]!==undefined$1?arguments[1]:true;var n=arguments.length>2&&arguments[2]!==undefined$1?arguments[2]:false;if(e instanceof Pair||n&&e instanceof Array&&e[__data__]){return e}if(r===false){var t=nil;for(var i=e.length;i--;){t=new Pair(e[i],t)}return t}if(e.length&&!(e instanceof Array)){e=toConsumableArray(e)}var a=nil;var u=e.length;while(u--){var o=e[u];if(o instanceof Array){o=Pair.fromArray(o,r,n)}else if(typeof o==="string"){o=LString(o)}else if(typeof o==="number"&&!Number.isNaN(o)){o=LNumber(o)}a=new Pair(o,a)}return a};Pair.prototype.toObject=function(){var e=arguments.length>0&&arguments[0]!==undefined$1?arguments[0]:false;var r=this;var n={};while(true){if(r instanceof Pair&&r.car instanceof Pair){var t=r.car;var i=t.car;if(i instanceof LSymbol){i=i.__name__}if(i instanceof LString){i=i.valueOf()}var a=t.cdr;if(a instanceof Pair){a=a.toObject(e)}if(is_native(a)){if(!e){a=a.valueOf()}}n[i]=a;r=r.cdr}else{break}}return n};Pair.fromPairs=function(e){return e.reduce(function(e,r){return new Pair(new Pair(new LSymbol(r[0]),r[1]),e)},nil)};Pair.fromObject=function(r){var e=Object.keys(r).map(function(e){return[e,r[e]]});return Pair.fromPairs(e)};Pair.prototype.reduce=function(e){var r=this;var n=nil;while(true){if(r!==nil){n=e(n,r.car);r=r.cdr}else{break}}return n};Pair.prototype.reverse=function(){if(this.haveCycles()){throw new Error("You can't reverse list that have cycles")}var e=this;var r=nil;while(e!==nil){var n=e.cdr;e.cdr=r;r=e;e=n}return r};Pair.prototype.transform=function(t){function i(e){if(e instanceof Pair){if(e.replace){delete e.replace;return e}var r=t(e.car);if(r instanceof Pair){r=i(r)}var n=t(e.cdr);if(n instanceof Pair){n=i(n)}return new Pair(r,n)}return e}return i(this)};Pair.prototype.map=function(e){if(typeof this.car!=="undefined"){return new Pair(e(this.car),this.cdr===nil?nil:this.cdr.map(e))}else{return nil}};var repr=new Map;function is_plain_object(e){return e&&_typeof_1(e)==="object"&&e.constructor===Object}var props=Object.getOwnPropertyNames(Array.prototype);var array_methods=[];props.forEach(function(e){array_methods.push(Array[e],Array.prototype[e])});function is_array_method(e){e=unbind(e);return array_methods.includes(e)}function is_lips_function(e){return is_function(e)&&(e[__lambda__]||e.__doc__)}function user_repr(n){var e=n.constructor||Object;var t=is_plain_object(n);var i=is_function(n[Symbol.asyncIterator])||is_function(n[Symbol.iterator]);var a;if(repr.has(e)){a=repr.get(e)}else{repr.forEach(function(e,r){r=unbind(r);if(n.constructor===r&&(r===Object&&t&&!i||r!==Object)){a=e}})}return a}var str_mapping=new Map;[[Number.NEGATIVE_INFINITY,"-inf.0"],[Number.POSITIVE_INFINITY,"+inf.0"],[true,"#t"],[false,"#f"],[null,"null"],[undefined$1,"#"]].forEach(function(e){var r=slicedToArray(e,2),n=r[0],t=r[1];str_mapping.set(n,t)});function symbolize(n){if(n&&_typeof_1(n)==="object"){var t={};var e=Object.getOwnPropertySymbols(n);e.forEach(function(e){var r=e.toString().replace(/Symbol\(([^)]+)\)/,"$1");t[r]=toString(n[e])});var r=Object.getOwnPropertyNames(n);r.forEach(function(e){var r=n[e];if(r&&_typeof_1(r)==="object"&&r.constructor===Object){t[e]=symbolize(r)}else{t[e]=toString(r)}});return t}return n}function get_props(e){return Object.keys(e).concat(Object.getOwnPropertySymbols(e))}function has_own_function(e,r){return e.hasOwnProperty(r)&&is_function(e.toString)}function function_to_string(e){if(is_native_function(e)){return"#"}var r=e.prototype&&e.prototype.constructor;if(is_function(r)&&r[__lambda__]){if(e[__class__]&&r.hasOwnProperty("__name__")){var n=r.__name__;if(LString.isString(n)){n=n.toString();return"#")}return"#"}}if(e.hasOwnProperty("__name__")){var t=e.__name__;if(_typeof_1(t)==="symbol"){t=symbol_to_string(t)}if(typeof t==="string"){return"#")}}if(has_own_function(e,"toString")){return e.toString()}else if(e.name&&!e[__lambda__]){return"#")}else{return"#"}}function toString(e,r,n){if(typeof jQuery!=="undefined"&&e instanceof jQuery.fn.init){return"#"}if(str_mapping.has(e)){return str_mapping.get(e)}if(e instanceof Error){return e.message}if(e instanceof Pair){var t;if(!n){e.markCycles()}for(var i=arguments.length,a=new Array(i>3?i-3:0),u=3;u"}if(e===null){return"null"}if(_typeof_1(e)==="object"){if(is_function(e.toString)&&e.toString[__lambda__]){return e.toString().valueOf()}var f=e.constructor;if(!f){f=Object}var p;if(typeof f.__class__==="string"){p=f.__class__}else{if(is_prototype(e)){return"#"}var _=user_repr(e);if(_){if(is_function(_)){return _(e,r)}else{throw new Error("toString: Invalid repr value")}}p=f.name}if(type(e)==="instance"&&!is_native_function(f)){p="instance"}if(is_iterator(e,Symbol.iterator)){if(p){return"#")}return"#"}if(is_iterator(e,Symbol.asyncIterator)){if(p){return"#")}return"#"}if(p!==""){return"#<"+p+">"}return"#