spook

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | LICENSE

commit dc767ec826d7fade8da1d0d9a11a3d01321dd005
parent 9ca998b07d265576eea8402f279fd1a6ec80ae3f
Author: Yuval Langer <yuvallangerontheroad@gmail.com>
Date:   Mon, 23 Oct 2023 06:23:12 +0300

Remove Chicken Spock runtime.

Diffstat:
Dspock-runtime-debug-min.js | 453-------------------------------------------------------------------------------
Dspock-runtime-debug.js | 4963-------------------------------------------------------------------------------
Dspock-runtime-min.js | 440-------------------------------------------------------------------------------
Dspock-runtime.js | 4524-------------------------------------------------------------------------------
4 files changed, 0 insertions(+), 10380 deletions(-)

diff --git a/spock-runtime-debug-min.js b/spock-runtime-debug-min.js @@ -1,452 +0,0 @@ - -var SPOCK={STACKSIZE:100,THREADSLICE:10,TRACELENGTH:32};SPOCK.modules={};SPOCK.symbolTable={};SPOCK.stack=0;SPOCK.limit=SPOCK.STACKSIZE;SPOCK.debug=false;SPOCK.running=false;SPOCK.runHook=[];SPOCK.inBrowser="document"in this;SPOCK.global=this;SPOCK.Continuation=function(func,args){this.k_callee=func;this.k_arguments=args;};SPOCK.Result=function(val){this.value=val;};SPOCK.Symbol=function(name){this.name=name;this.plist={};};SPOCK.Pair=function(car,cdr){this.car=car;this.cdr=cdr;};SPOCK.String=function(chars){if(typeof chars==="string"){this.parts=[chars];this.length=chars.length;} -else if(typeof chars==="number")this.parts=[chars.toString()];else this.parts=chars;};SPOCK.Char=function(str){this.character=str.charAt(0);};SPOCK.Port=function(direction,methods){var port=this;var read=methods.read||function(){SPOCK.error("reading from non-input port",port);};function doread(n){if(n===0)return"";else if(this.peeked){var p=this.peeked;this.peeked=false;if(n===1)return p;else return p+read(n-1);} -else return read(n);} -this.peeked=false;this.direction=direction;this.read=doread;this.write=methods.write||function(){SPOCK.error("writing to non-output port",port)};this.close=methods.close||function(){};this.flush=methods.flush||function(){};this.ready=methods.ready||function(){return true;};this.closed=false;};SPOCK.Promise=function(thunk){this.thunk=thunk;};SPOCK.EndOfFile=function(){};SPOCK.EOF=new SPOCK.EndOfFile();SPOCK.check=function(val,type,loc){if(typeof type==="function"&&val instanceof type)return val;if(typeof val===type)return val;else SPOCK.error((loc?"("+loc+") ":"")+"bad argument type"+ -(typeof type==="string"?" - expected `"+type+"'":""),val);};SPOCK.intern=function(str){var old=SPOCK.symbolTable[str];if(old)return old;else return SPOCK.symbolTable[str]=new SPOCK.Symbol(str);};SPOCK.stringify=function(x,readable){if(readable===undefined)readable=true;if(typeof x==="function")return"#<procedure>";else if(x===undefined)return"#<undefined>";else if(x===null)return"()";else if(x instanceof SPOCK.Continuation)return"#<continuation>";else if(x instanceof SPOCK.Symbol)return x.name;else if(x instanceof SPOCK.Pair){var str="(";var f=false;for(var p=x;p!==null&&p instanceof SPOCK.Pair;p=p.cdr){if(f)str+=" ";str+=SPOCK.stringify(p.car,readable);f=true;} -if(p!==null)str+=" . "+SPOCK.stringify(p,readable);return str+")";} -else if(x instanceof Array){var str="#(";var f=false;for(var i in x){if(f)str+=" ";str+=SPOCK.stringify(x[i],readable);f=true;} -return str+")";} -else if(x instanceof SPOCK.String){if(readable) -return"\""+x.normalize()+"\"";else return x.normalize();} -else if(x instanceof SPOCK.Char){if(readable)return x.character;switch(x.character){case"\n":return"#\\newline";case"\t":return"#\\tab";case"\r":return"#\\return";case" ":return"#\\space";default:return"#\\"+x.character;}} -else if(x instanceof SPOCK.Port) -return"#<"+x.direction+" port"+ -(x.name?(" \""+x.name+"\">"):">");else if(x instanceof SPOCK.Promise)return"#<promise>";else if(x instanceof SPOCK.EndOfFile)return"#<eof>";else return x.toString();};SPOCK.error=function(msg){var args=Array.prototype.splice.call(arguments,1);function argstr(x){return SPOCK.stringify(x,true);} -if(args.length>0) -msg=msg+":\n "+SPOCK.map(argstr,args).join("\n ");throw new Error(msg);};if(this.quit)SPOCK.exit=quit;else SPOCK.exit=function(code){SPOCK.error("no suitable primitive available for `exit'");};SPOCK.String.prototype.normalize=function(){if(this.parts.length===0)return"";this.parts=[this.parts.join("")];return this.parts[0];};SPOCK.jstring=function(x){if(typeof x==="string")return x;else if(x instanceof SPOCK.String)return x.normalize();else return x;};SPOCK.list=function(){var lst=null;var len=arguments.length;for(var i=len-1;i>=0;--i) -lst=new SPOCK.Pair(arguments[i],lst);return lst;};SPOCK.length=function(lst){for(var n=0;lst instanceof SPOCK.Pair;++n) -lst=lst.cdr;return n;};SPOCK.map=function(func,array){var len=array.length;var a2=new Array(len);for(var i in array) -a2[i]=func(array[i]);return a2;};SPOCK.eqvp=function(x,y){if(x===y)return true;else if(x instanceof SPOCK.Char) -return y instanceof SPOCK.Char&&x.character===y.character;else return false;};SPOCK.equalp=function(x,y){if(x===y)return true;else if(x instanceof SPOCK.Pair) -return y instanceof SPOCK.Pair&&SPOCK.equalp(x.car,y.car)&&SPOCK.equalp(x.cdr,y.cdr);else if(x instanceof Array){var len=x.length;if(!(y instanceof Array)||y.length!=len)return false;for(var i=0;i<len;++i){if(!SPOCK.equalp(x[i],y[i]))return false;} -return true;} -else if(x instanceof SPOCK.Char) -return y instanceof SPOCK.Char&&x.characters===y.characters;else if(x instanceof SPOCK.String){var s1=x.normalize();if(y instanceof SPOCK.String)return s1===y.normalize();else if(typeof y==='string')return s1===y;else return false;} -else if(typeof x==='string'){if(y instanceof SPOCK.String)return x===y.normalize();else if(typeof y==='string')return x===y;else return false;} -else return false;};SPOCK.count=function(args,loc){if(--SPOCK.stack<=0) -return new SPOCK.Continuation(args.callee,Array.prototype.slice.call(args));else return false;};SPOCK.rest=function(args,count,loc){var rest=null;SPOCK.count(args,loc);for(var i=args.length-1;i>=count;--i) -rest=new SPOCK.Pair(args[i],rest);return rest;};SPOCK.statistics=function(){};SPOCK.run=function(func){function terminate(result){return new SPOCK.Result(result);} -var k=terminate;var args=[k].concat(Array.prototype.slice.call(arguments,1));var oldstack=SPOCK.stack;var oldlimit=SPOCK.limit;var oldrunning=SPOCK.running;SPOCK.limit=Math.max(10,oldlimit-oldstack);SPOCK.stack=SPOCK.limit;SPOCK.running=true;function restore(){SPOCK.stack=oldstack;SPOCK.limit=oldlimit;SPOCK.running=oldrunning;if(!oldrunning){for(var i in SPOCK.runHook) -(SPOCK.runHook[i])(false);}} -var result;if(!oldrunning){for(var i in SPOCK.runHook) -(SPOCK.runHook[i])(true);} -while(true){result=func.apply(SPOCK.global,args);if(result instanceof SPOCK.Continuation){SPOCK.stack=SPOCK.STACKSIZE;func=result.k_callee;args=result.k_arguments;} -else if(result instanceof SPOCK.Result){restore();return result.value;} -else{restore();SPOCK.error("unexpected return of non-continuation",result);}} -return result;};SPOCK.callback=function(proc){return function(){var args=Array.prototype.slice.call(arguments);args.unshift(proc);return SPOCK.run.apply(this,args);};};SPOCK.callbackMethod=function(proc){var g=this;return function(){var args=Array.prototype.slice.call(arguments);args.unshift(this);args.unshift(proc);return SPOCK.run.apply(g,args);};};SPOCK.go=function(proc){(SPOCK.callback(proc))();};if("java"in this){SPOCK.makeJavaInputPort=function(jp){return new SPOCK.Port("input",{read:function(n){var buffer="";while(n--){var b=jp.read();if(b===-1)break;else buffer+=String.fromCharCode(b);} -return buffer===""?SPOCK.EOF:buffer;},close:function(){jp.close();}});};SPOCK.makeJavaOutputPort=function(jp){return new SPOCK.Port("output",{write:function(s){var len=s.length;for(var i=0;i<len;++i) -jp.write(s.charCodeAt(i));},flush:function(){jp.flush();},close:function(){jp.close();}});};SPOCK.log=function(){java.lang.System.err.println(Array.prototype.slice.call(arguments).join(""));};SPOCK.stdin=SPOCK.makeJavaInputPort(java.lang.System["in"]);SPOCK.stdout=SPOCK.makeJavaOutputPort(java.lang.System.out);SPOCK.stderr=SPOCK.makeJavaOutputPort(java.lang.System.err);SPOCK.stderr.name="[stderr]";} -else{if("console"in this)SPOCK.log=console.log;else if(SPOCK.inBrowser) -SPOCK.log=function(){var msg=arguments.join(" ");if(msg.charAt(msg.length-1)=="\n") -msg=msg.substring(0,msg.length-1);this.defaultStatus=msg;};else if("print"in this)SPOCK.log=print;else if(typeof process!==undefined)SPOCK.log=console.log;else SPOCK.error("no suitable output primitive available");(function(){var buffer=[];function flush(){if(buffer.length>0){SPOCK.log(buffer.join(""));buffer=[];}} -function write(s){var parts=SPOCK.stringify(s,false).split("\n");var len=parts.length-1;if(len>0){buffer.push(parts[0]);flush();if(len>1){for(var i=1;i<len;++i) -SPOCK.log(parts[i]);} -buffer.push(parts[len]);} -else buffer.push(parts[0]);} -SPOCK.stdout=new SPOCK.Port("output",{write:write,flush:flush});var inp;var ibuffer="";if(this.prompt){inp=function(n){while(true){if(ibuffer.length<=n){var part=ibuffer.slice(0,n);ibuffer=ibuffer.slice(n);return part;} -var input=prompt("Expecting input for "+this.toString());if(input===null)return SPOCK.EOF;else ibuffer+=input;}};} -else{inp=function(n){SPOCK.error("no input possible for standard input port");};} -SPOCK.stdin=new SPOCK.Port("input",{read:inp});SPOCK.stderr=SPOCK.stdout;})();} -SPOCK.stdin.name="[stdin]";SPOCK.stdout.name="[stdout]";SPOCK.flush=function(){SPOCK.stdout.flush();if(SPOCK.stderr!==SPOCK.stdout) -SPOCK.stderr.flush();SPOCK.statistics();};if(this.gc)SPOCK.gc=gc;else SPOCK.gc=function(){};SPOCK.openInputUrlHook=function(url){SPOCK.error("can not open",url);};SPOCK.openOutputUrlHook=function(url){SPOCK.error("can not open",url);};if("java"in this){SPOCK.openInputFile=function(filename){var stream;try{stream=new java.io.FileInputStream(filename);} -catch(e){SPOCK.error(e.message);} -var port=SPOCK.makeJavaInputPort(stream);port.name=filename;return port;};SPOCK.openOutputFile=function(filename){var stream;try{stream=new java.io.FileOutputStream(filename);} -catch(e){SPOCK.error(e.message);} -var port=SPOCK.makeJavaOutputPort(stream);port.name=filename;return port;};SPOCK.fileExists=function(filename){return(new java.io.File(filename)).exists();};} -else{if(SPOCK.inBrowser){SPOCK.openInputFile=function(filename){if(filename.match(/^[a-z0-9]+:/)) -return SPOCK.openInputUrlHook(filename);var cookies=document.cookie.split("; ");var buffer=null;for(var i=0;i<cookies.length;++i){var c=cookies[i];var p=c.indexOf("=");if(filename===c.substring(0,p)){buffer=c.substring(p+1);break;}} -if(!buffer)SPOCK.error("can not open file",filename);var pos=0;return new SPOCK.Port("input",{read:function(n){if(pos>=buffer.length)return SPOCK.EOF;else if(pos+len>=buffer.length) -return buffer.substring(pos);var p1=pos;pos+=n;return buffer.substring(p1,p1+n);},ready:function(){return pos<buffer.length;}});};SPOCK.openOutputFile=function(filename,expiry){if(filename.match(/^[a-z0-9]+:/)) -return SPOCK.openOutputUrlHook(filename);return new SPOCK.Port("output",{write:function(s){buffer+=s;},close:function(){var now=(new Date()).getTime();var exp=now+(expiry||(1000*60*60*24*365));document.cookie=filename+"="+encodeURIComponent(buffer)+"; expires="+(new Date(exp)).toGMTString();}});};} -else{SPOCK.openInputFile=function(filename){SPOCK.error("file-I/O not available");} -SPOCK.openOutputFile=function(filename){SPOCK.error("file-I/O not available");}} -SPOCK.fileExists=function(filename){SPOCK.error("`file-exists?' not available");};} -if("document"in this){SPOCK.load=function(url,k){var script=document.createElement("script") -script.type="text/javascript";k=k||function(){};if(script.readyState){script.onreadystatechange=function(){if(script.readyState=="loaded"||script.readyState=="complete"){script.onreadystatechange=null;k(url);}};} -else{script.onload=function(){k(url);};} -script.src=url;document.getElementsByTagName("head")[0].appendChild(script);};} -else if("load"in this){SPOCK.load=function(filename,k){load(filename);if(k)k(filename);};} -SPOCK.debug=true;SPOCK.toString=function(){return"#<SPOCK>";};SPOCK.restartCount=0;SPOCK.traceBuffer=[];SPOCK.traceOutput=false;SPOCK.traceHook=[];SPOCK.hasAlert=SPOCK.inBrowser;SPOCK.error=function(msg){var args=Array.prototype.splice.call(arguments,1);var err;var text;if(typeof msg!=="string"){err=msg;msg=err.message;} -text=msg;if(args.length>1) -text+=":\n "+SPOCK.map(SPOCK.stringify,args).join("\n ");if(SPOCK.traceBuffer.length>0) -text+="\n\nCall trace:\n\n"+SPOCK.getTrace();if(SPOCK.hasAlert){alert("Error: "+text);SPOCK.hasAlert=false;} -else if(err)throw new(err.constructor)(text);else throw new Error(text);};SPOCK.count=function(args,loc){if(--SPOCK.stack<=0){++SPOCK.restartCount;return new SPOCK.Continuation(args.callee,Array.prototype.slice.call(args));} -if(loc)SPOCK.trace(loc,args);return false;};SPOCK.trace=function(name,args){var tb=SPOCK.traceBuffer;for(var i in SPOCK.traceHook) -(SPOCK.traceHook[i])(name,args);if(SPOCK.traceOutput) -SPOCK.log("["+SPOCK.stack+"] "+name);if(tb.length>=SPOCK.TRACELENGTH)tb.shift();tb.push([name,Array.prototype.slice.call(args,1)]);};SPOCK.getTrace=function(){var tb=SPOCK.traceBuffer;var trace=[];for(var i in tb){var e=tb[i];trace.push(" ("+e[0]+" "+ -SPOCK.map(SPOCK.stringify,e[1]).join(" ")+")");} -SPOCK.traceBuffer=[];return trace.join("\n")+" <---";};SPOCK.statistics=function(){SPOCK.traceBuffer=[];};(function(){var old=SPOCK.callback;SPOCK.callback=function(proc){var cb=old(proc);return function(){var args=Array.prototype.slice.call(arguments);SPOCK.trace("<callback>",args);return cb.apply(this,args);};};})();var t1336=function(k1067){var t1337=function(k1068,t1){var t1=SPOCK.rest(arguments,1,'%list');loop:while(true){return k1068(t1);}};____25list=t1337;var t1339=function(K){SPOCK.count(arguments,'values');return K.apply(SPOCK.global,Array.prototype.slice.call(arguments,1));};___values=t1339;var t1340=function(K){SPOCK.count(arguments,'call-with-values');var thunk=arguments[1];var proc=arguments[2];function k2(){var args=Array.prototype.slice.call(arguments);args.unshift(K);return proc.apply(SPOCK.global,args);} -return thunk(k2);};___call_2dwith_2dvalues=t1340;var t1341=function(K){SPOCK.count(arguments,'%call-with-saved-values');var t1=arguments[1];var t2=arguments[2];var args;function k2(){return K.apply(SPOCK.global,args);} -function k1(){args=Array.prototype.slice.call(arguments);return t2(k2);} -return t1(k1);};____25call_2dwith_2dsaved_2dvalues=t1341;var t1342=function(k1069,t2){var r=SPOCK.count(arguments,"list?");if(r)return r;var t3=undefined;var t1343=function(k1070,t4,t5){var r=SPOCK.count(arguments,"t3");if(r)return r;loop:while(true){var t1345=null;var t1344=(t4)===(t1345);var t6=t1344;var t1346;if(t6!==false){return k1070(t6);} -else{var t1348=(t4)instanceof SPOCK.Pair;var t945=t1348;var t1349;if(t945!==false){var t1350=t4.cdr;var t11=t1350;var t1352=null;var t1351=(t11)===(t1352);var t13=t1351;var t1353;if(t13!==false){return k1070(t13);} -else{var t1355=(t11)instanceof SPOCK.Pair;var t946=t1355;var t1356;if(t946!==false){var t1357=t11.cdr;var t18=t1357;var t1358=t5.cdr;var t19=t1358;var t1359=(t18)===(t19);var t22=t1359;var t1360;if(t22!==false){t1360=false;} -else{t1360=true;} -var t947=t1360;var t1361;if(t947!==false){var t1362=t18;var t1363=t19;t4=t1362;t5=t1363;continue loop;} -else{return k1070(false);} -t1356=t1361;} -else{return k1070(false);} -t1353=t1356;} -t1349=t1353;} -else{return k1070(false);} -t1346=t1349;}}};t3=t1343;return t3(k1069,t2,t2);};___list_3f=t1342;var t1368=function(k1071,t25){var r=SPOCK.count(arguments,"caaar");if(r)return r;loop:while(true){var t1369=SPOCK.check(t25,SPOCK.Pair,"caaar");var t29=t1369;var t1370=t29.car;var t27=t1370;var t1371=SPOCK.check(t27,SPOCK.Pair,"caaar");var t30=t1371;var t1372=t30.car;var t26=t1372;var t1373=SPOCK.check(t26,SPOCK.Pair,"caaar");var t31=t1373;var t1374=t31.car;return k1071(t1374);}};___caaar=t1368;var t1376=function(k1072,t32){var r=SPOCK.count(arguments,"caadr");if(r)return r;loop:while(true){var t1377=SPOCK.check(t32,SPOCK.Pair,"caadr");var t36=t1377;var t1378=t36.cdr;var t34=t1378;var t1379=SPOCK.check(t34,SPOCK.Pair,"caadr");var t37=t1379;var t1380=t37.car;var t33=t1380;var t1381=SPOCK.check(t33,SPOCK.Pair,"caadr");var t38=t1381;var t1382=t38.car;return k1072(t1382);}};___caadr=t1376;var t1384=function(k1073,t39){var r=SPOCK.count(arguments,"cadar");if(r)return r;loop:while(true){var t1385=SPOCK.check(t39,SPOCK.Pair,"cadar");var t43=t1385;var t1386=t43.car;var t41=t1386;var t1387=SPOCK.check(t41,SPOCK.Pair,"cadar");var t44=t1387;var t1388=t44.cdr;var t40=t1388;var t1389=SPOCK.check(t40,SPOCK.Pair,"cadar");var t45=t1389;var t1390=t45.car;return k1073(t1390);}};___cadar=t1384;var t1392=function(k1074,t46){var r=SPOCK.count(arguments,"caddr");if(r)return r;loop:while(true){var t1393=SPOCK.check(t46,SPOCK.Pair,"caddr");var t50=t1393;var t1394=t50.cdr;var t48=t1394;var t1395=SPOCK.check(t48,SPOCK.Pair,"caddr");var t51=t1395;var t1396=t51.cdr;var t47=t1396;var t1397=SPOCK.check(t47,SPOCK.Pair,"caddr");var t52=t1397;var t1398=t52.car;return k1074(t1398);}};___caddr=t1392;var t1400=function(k1075,t53){var r=SPOCK.count(arguments,"cdaar");if(r)return r;loop:while(true){var t1401=SPOCK.check(t53,SPOCK.Pair,"cdaar");var t57=t1401;var t1402=t57.car;var t55=t1402;var t1403=SPOCK.check(t55,SPOCK.Pair,"cdaar");var t58=t1403;var t1404=t58.car;var t54=t1404;var t1405=SPOCK.check(t54,SPOCK.Pair,"cdaar");var t59=t1405;var t1406=t59.cdr;return k1075(t1406);}};___cdaar=t1400;var t1408=function(k1076,t60){var r=SPOCK.count(arguments,"cdadr");if(r)return r;loop:while(true){var t1409=SPOCK.check(t60,SPOCK.Pair,"cdadr");var t64=t1409;var t1410=t64.cdr;var t62=t1410;var t1411=SPOCK.check(t62,SPOCK.Pair,"cdadr");var t65=t1411;var t1412=t65.car;var t61=t1412;var t1413=SPOCK.check(t61,SPOCK.Pair,"cdadr");var t66=t1413;var t1414=t66.cdr;return k1076(t1414);}};___cdadr=t1408;var t1416=function(k1077,t67){var r=SPOCK.count(arguments,"cddar");if(r)return r;loop:while(true){var t1417=SPOCK.check(t67,SPOCK.Pair,"cddar");var t71=t1417;var t1418=t71.car;var t69=t1418;var t1419=SPOCK.check(t69,SPOCK.Pair,"cddar");var t72=t1419;var t1420=t72.cdr;var t68=t1420;var t1421=SPOCK.check(t68,SPOCK.Pair,"cddar");var t73=t1421;var t1422=t73.cdr;return k1077(t1422);}};___cddar=t1416;var t1424=function(k1078,t74){var r=SPOCK.count(arguments,"cdddr");if(r)return r;loop:while(true){var t1425=SPOCK.check(t74,SPOCK.Pair,"cdddr");var t78=t1425;var t1426=t78.cdr;var t76=t1426;var t1427=SPOCK.check(t76,SPOCK.Pair,"cdddr");var t79=t1427;var t1428=t79.cdr;var t75=t1428;var t1429=SPOCK.check(t75,SPOCK.Pair,"cdddr");var t80=t1429;var t1430=t80.cdr;return k1078(t1430);}};___cdddr=t1424;var t1432=function(k1079,t81){var r=SPOCK.count(arguments,"caaaar");if(r)return r;loop:while(true){var t1433=SPOCK.check(t81,SPOCK.Pair,"caaaar");var t86=t1433;var t1434=t86.car;var t84=t1434;var t1435=SPOCK.check(t84,SPOCK.Pair,"caaaar");var t87=t1435;var t1436=t87.car;var t83=t1436;var t1437=SPOCK.check(t83,SPOCK.Pair,"caaaar");var t88=t1437;var t1438=t88.car;var t82=t1438;var t1439=SPOCK.check(t82,SPOCK.Pair,"caaaar");var t89=t1439;var t1440=t89.car;return k1079(t1440);}};___caaaar=t1432;var t1442=function(k1080,t90){var r=SPOCK.count(arguments,"caaadr");if(r)return r;loop:while(true){var t1443=SPOCK.check(t90,SPOCK.Pair,"caaadr");var t95=t1443;var t1444=t95.cdr;var t93=t1444;var t1445=SPOCK.check(t93,SPOCK.Pair,"caaadr");var t96=t1445;var t1446=t96.car;var t92=t1446;var t1447=SPOCK.check(t92,SPOCK.Pair,"caaadr");var t97=t1447;var t1448=t97.car;var t91=t1448;var t1449=SPOCK.check(t91,SPOCK.Pair,"caaadr");var t98=t1449;var t1450=t98.car;return k1080(t1450);}};___caaadr=t1442;var t1452=function(k1081,t99){var r=SPOCK.count(arguments,"caadar");if(r)return r;loop:while(true){var t1453=SPOCK.check(t99,SPOCK.Pair,"caadar");var t104=t1453;var t1454=t104.car;var t102=t1454;var t1455=SPOCK.check(t102,SPOCK.Pair,"caadar");var t105=t1455;var t1456=t105.cdr;var t101=t1456;var t1457=SPOCK.check(t101,SPOCK.Pair,"caadar");var t106=t1457;var t1458=t106.car;var t100=t1458;var t1459=SPOCK.check(t100,SPOCK.Pair,"caadar");var t107=t1459;var t1460=t107.car;return k1081(t1460);}};___caadar=t1452;var t1462=function(k1082,t108){var r=SPOCK.count(arguments,"caaddr");if(r)return r;loop:while(true){var t1463=SPOCK.check(t108,SPOCK.Pair,"caaddr");var t113=t1463;var t1464=t113.cdr;var t111=t1464;var t1465=SPOCK.check(t111,SPOCK.Pair,"caaddr");var t114=t1465;var t1466=t114.cdr;var t110=t1466;var t1467=SPOCK.check(t110,SPOCK.Pair,"caaddr");var t115=t1467;var t1468=t115.car;var t109=t1468;var t1469=SPOCK.check(t109,SPOCK.Pair,"caaddr");var t116=t1469;var t1470=t116.car;return k1082(t1470);}};___caaddr=t1462;var t1472=function(k1083,t117){var r=SPOCK.count(arguments,"cadaar");if(r)return r;loop:while(true){var t1473=SPOCK.check(t117,SPOCK.Pair,"cadaar");var t122=t1473;var t1474=t122.car;var t120=t1474;var t1475=SPOCK.check(t120,SPOCK.Pair,"cadaar");var t123=t1475;var t1476=t123.car;var t119=t1476;var t1477=SPOCK.check(t119,SPOCK.Pair,"cadaar");var t124=t1477;var t1478=t124.cdr;var t118=t1478;var t1479=SPOCK.check(t118,SPOCK.Pair,"cadaar");var t125=t1479;var t1480=t125.car;return k1083(t1480);}};___cadaar=t1472;var t1482=function(k1084,t126){var r=SPOCK.count(arguments,"cadadr");if(r)return r;loop:while(true){var t1483=SPOCK.check(t126,SPOCK.Pair,"cadadr");var t131=t1483;var t1484=t131.cdr;var t129=t1484;var t1485=SPOCK.check(t129,SPOCK.Pair,"cadadr");var t132=t1485;var t1486=t132.car;var t128=t1486;var t1487=SPOCK.check(t128,SPOCK.Pair,"cadadr");var t133=t1487;var t1488=t133.cdr;var t127=t1488;var t1489=SPOCK.check(t127,SPOCK.Pair,"cadadr");var t134=t1489;var t1490=t134.car;return k1084(t1490);}};___cadadr=t1482;var t1492=function(k1085,t135){var r=SPOCK.count(arguments,"caddar");if(r)return r;loop:while(true){var t1493=SPOCK.check(t135,SPOCK.Pair,"caddar");var t140=t1493;var t1494=t140.car;var t138=t1494;var t1495=SPOCK.check(t138,SPOCK.Pair,"caddar");var t141=t1495;var t1496=t141.cdr;var t137=t1496;var t1497=SPOCK.check(t137,SPOCK.Pair,"caddar");var t142=t1497;var t1498=t142.cdr;var t136=t1498;var t1499=SPOCK.check(t136,SPOCK.Pair,"caddar");var t143=t1499;var t1500=t143.car;return k1085(t1500);}};___caddar=t1492;var t1502=function(k1086,t144){var r=SPOCK.count(arguments,"cadddr");if(r)return r;loop:while(true){var t1503=SPOCK.check(t144,SPOCK.Pair,"cadddr");var t149=t1503;var t1504=t149.cdr;var t147=t1504;var t1505=SPOCK.check(t147,SPOCK.Pair,"cadddr");var t150=t1505;var t1506=t150.cdr;var t146=t1506;var t1507=SPOCK.check(t146,SPOCK.Pair,"cadddr");var t151=t1507;var t1508=t151.cdr;var t145=t1508;var t1509=SPOCK.check(t145,SPOCK.Pair,"cadddr");var t152=t1509;var t1510=t152.car;return k1086(t1510);}};___cadddr=t1502;var t1512=function(k1087,t153){var r=SPOCK.count(arguments,"cdaaar");if(r)return r;loop:while(true){var t1513=SPOCK.check(t153,SPOCK.Pair,"cdaaar");var t158=t1513;var t1514=t158.car;var t156=t1514;var t1515=SPOCK.check(t156,SPOCK.Pair,"cdaaar");var t159=t1515;var t1516=t159.car;var t155=t1516;var t1517=SPOCK.check(t155,SPOCK.Pair,"cdaaar");var t160=t1517;var t1518=t160.car;var t154=t1518;var t1519=SPOCK.check(t154,SPOCK.Pair,"cdaaar");var t161=t1519;var t1520=t161.cdr;return k1087(t1520);}};___cdaaar=t1512;var t1522=function(k1088,t162){var r=SPOCK.count(arguments,"cdaadr");if(r)return r;loop:while(true){var t1523=SPOCK.check(t162,SPOCK.Pair,"cdaadr");var t167=t1523;var t1524=t167.cdr;var t165=t1524;var t1525=SPOCK.check(t165,SPOCK.Pair,"cdaadr");var t168=t1525;var t1526=t168.car;var t164=t1526;var t1527=SPOCK.check(t164,SPOCK.Pair,"cdaadr");var t169=t1527;var t1528=t169.car;var t163=t1528;var t1529=SPOCK.check(t163,SPOCK.Pair,"cdaadr");var t170=t1529;var t1530=t170.cdr;return k1088(t1530);}};___cdaadr=t1522;var t1532=function(k1089,t171){var r=SPOCK.count(arguments,"cdadar");if(r)return r;loop:while(true){var t1533=SPOCK.check(t171,SPOCK.Pair,"cdadar");var t176=t1533;var t1534=t176.car;var t174=t1534;var t1535=SPOCK.check(t174,SPOCK.Pair,"cdadar");var t177=t1535;var t1536=t177.cdr;var t173=t1536;var t1537=SPOCK.check(t173,SPOCK.Pair,"cdadar");var t178=t1537;var t1538=t178.car;var t172=t1538;var t1539=SPOCK.check(t172,SPOCK.Pair,"cdadar");var t179=t1539;var t1540=t179.cdr;return k1089(t1540);}};___cdadar=t1532;var t1542=function(k1090,t180){var r=SPOCK.count(arguments,"cdaddr");if(r)return r;loop:while(true){var t1543=SPOCK.check(t180,SPOCK.Pair,"cdaddr");var t185=t1543;var t1544=t185.cdr;var t183=t1544;var t1545=SPOCK.check(t183,SPOCK.Pair,"cdaddr");var t186=t1545;var t1546=t186.cdr;var t182=t1546;var t1547=SPOCK.check(t182,SPOCK.Pair,"cdaddr");var t187=t1547;var t1548=t187.car;var t181=t1548;var t1549=SPOCK.check(t181,SPOCK.Pair,"cdaddr");var t188=t1549;var t1550=t188.cdr;return k1090(t1550);}};___cdaddr=t1542;var t1552=function(k1091,t189){var r=SPOCK.count(arguments,"cddaar");if(r)return r;loop:while(true){var t1553=SPOCK.check(t189,SPOCK.Pair,"cddaar");var t194=t1553;var t1554=t194.car;var t192=t1554;var t1555=SPOCK.check(t192,SPOCK.Pair,"cddaar");var t195=t1555;var t1556=t195.car;var t191=t1556;var t1557=SPOCK.check(t191,SPOCK.Pair,"cddaar");var t196=t1557;var t1558=t196.cdr;var t190=t1558;var t1559=SPOCK.check(t190,SPOCK.Pair,"cddaar");var t197=t1559;var t1560=t197.cdr;return k1091(t1560);}};___cddaar=t1552;var t1562=function(k1092,t198){var r=SPOCK.count(arguments,"cddadr");if(r)return r;loop:while(true){var t1563=SPOCK.check(t198,SPOCK.Pair,"cddadr");var t203=t1563;var t1564=t203.cdr;var t201=t1564;var t1565=SPOCK.check(t201,SPOCK.Pair,"cddadr");var t204=t1565;var t1566=t204.car;var t200=t1566;var t1567=SPOCK.check(t200,SPOCK.Pair,"cddadr");var t205=t1567;var t1568=t205.cdr;var t199=t1568;var t1569=SPOCK.check(t199,SPOCK.Pair,"cddadr");var t206=t1569;var t1570=t206.cdr;return k1092(t1570);}};___cddadr=t1562;var t1572=function(k1093,t207){var r=SPOCK.count(arguments,"cdddar");if(r)return r;loop:while(true){var t1573=SPOCK.check(t207,SPOCK.Pair,"cdddar");var t212=t1573;var t1574=t212.car;var t210=t1574;var t1575=SPOCK.check(t210,SPOCK.Pair,"cdddar");var t213=t1575;var t1576=t213.cdr;var t209=t1576;var t1577=SPOCK.check(t209,SPOCK.Pair,"cdddar");var t214=t1577;var t1578=t214.cdr;var t208=t1578;var t1579=SPOCK.check(t208,SPOCK.Pair,"cdddar");var t215=t1579;var t1580=t215.cdr;return k1093(t1580);}};___cdddar=t1572;var t1582=function(k1094,t216){var r=SPOCK.count(arguments,"cddddr");if(r)return r;loop:while(true){var t1583=SPOCK.check(t216,SPOCK.Pair,"cddddr");var t221=t1583;var t1584=t221.cdr;var t219=t1584;var t1585=SPOCK.check(t219,SPOCK.Pair,"cddddr");var t222=t1585;var t1586=t222.cdr;var t218=t1586;var t1587=SPOCK.check(t218,SPOCK.Pair,"cddddr");var t223=t1587;var t1588=t223.cdr;var t217=t1588;var t1589=SPOCK.check(t217,SPOCK.Pair,"cddddr");var t224=t1589;var t1590=t224.cdr;return k1094(t1590);}};___cddddr=t1582;var t1592=function(k1095,t225){var t225=SPOCK.rest(arguments,1,'append');var t1594=null;var t1593=(t225)===(t1594);var t948=t1593;var t1595;if(t948!==false){var t1596=null;return k1095(t1596);} -else{var t229=undefined;var t1598=function(k1096,t230){var r=SPOCK.count(arguments,"t229");if(r)return r;var t1599=t230.cdr;var t231=t1599;var t1601=null;var t1600=(t231)===(t1601);var t949=t1600;var t1602;if(t949!==false){var t1603=t230.car;return k1096(t1603);} -else{var t236=undefined;var t1605=function(k1097,t237){var r=SPOCK.count(arguments,"t236");if(r)return r;var t1606=(t237)instanceof SPOCK.Pair;var t950=t1606;var t1607;if(t950!==false){var t1608=t237.car;var t239=t1608;var t1609=function(t1098){var t240=t1098;var t1610=new SPOCK.Pair(t239,t240);return k1097(t1610);};var t1612=t237.cdr;return t236(t1609,t1612);} -else{var t243=t230;var t1614=t243.cdr;return t229(k1097,t1614);}};t236=t1605;var t1616=t230.car;return t236(k1096,t1616);}};t229=t1598;return t229(k1095,t225);}};___append=t1592;var t1619=function(k1099,t245){var r=SPOCK.count(arguments,"reverse");if(r)return r;var t246=undefined;var t1620=function(k1100,t247,t248){var r=SPOCK.count(arguments,"t246");if(r)return r;loop:while(true){var t1621=(t247)instanceof SPOCK.Pair;var t951=t1621;var t1622;if(t951!==false){var t1625=t247.cdr;var t1623=t1625;var t1626=t247.car;var t251=t1626;var t1627=new SPOCK.Pair(t251,t248);var t1624=t1627;t247=t1623;t248=t1624;continue loop;} -else{return k1100(t248);}}};t246=t1620;var t1629=null;return t246(k1099,t245,t1629);};___reverse=t1619;var t1631=function(k1101,t254,t255){var r=SPOCK.count(arguments,"list-tail");if(r)return r;var t256=undefined;var t1632=function(k1102,t257,t258){var r=SPOCK.count(arguments,"t256");if(r)return r;loop:while(true){var t1634=(t257)<=0;var t1633;if(t1634!==false){return k1102(t258);} -else{var t1638=(t257)-1;var t1636=t1638;var t1639=SPOCK.check(t258,SPOCK.Pair,"t256");var t259=t1639;var t1640=t259.cdr;var t1637=t1640;t257=t1636;t258=t1637;continue loop;}}};t256=t1632;var t1641=SPOCK.check(t255,'number',"list-tail");return t256(k1101,t1641,t254);};___list_2dtail=t1631;var t260=___list_2dtail;var t1643=function(k1103,t261,t262){var r=SPOCK.count(arguments,"t260");if(r)return r;var t1644=function(t1105){var t1645=SPOCK.check(t1105,SPOCK.Pair);var t1104=t1645;var t263=t1104;var t1646=t263.car;return k1103(t1646);};return t260(t1644,t261,t262);};___list_2dref=t1643;var t1649=function(K){SPOCK.count(arguments,'memq');var x=arguments[1];for(var n=arguments[2];n instanceof SPOCK.Pair;n=n.cdr){if(n.car===x)return K(n);} -return K(false);};___memq=t1649;var t1650=function(K){SPOCK.count(arguments,'memv');var x=arguments[1];for(var n=arguments[2];n instanceof SPOCK.Pair;n=n.cdr){if(SPOCK.eqvp(n.car,x))return K(n);} -return K(false);};___memv=t1650;var t1651=function(K){SPOCK.count(arguments,'member');var x=arguments[1];for(var n=arguments[2];n instanceof SPOCK.Pair;n=n.cdr){if(SPOCK.equalp(n.car,x))return K(n);} -return K(false);};___member=t1651;var t1652=function(K){SPOCK.count(arguments,'assq');var x=arguments[1];for(var n=arguments[2];n instanceof SPOCK.Pair;n=n.cdr){var p=n.car;if(p instanceof SPOCK.Pair&&p.car===x)return K(p);} -return K(false);};___assq=t1652;var t1653=function(K){SPOCK.count(arguments,'assv');var x=arguments[1];for(var n=arguments[2];n instanceof SPOCK.Pair;n=n.cdr){var p=n.car;if(p instanceof SPOCK.Pair&&SPOCK.eqvp(p.car,x))return K(p);} -return K(false);};___assv=t1653;var t1654=function(K){SPOCK.count(arguments,'assoc');var x=arguments[1];for(var n=arguments[2];n instanceof SPOCK.Pair;n=n.cdr){var p=n.car;if(p instanceof SPOCK.Pair&&SPOCK.equalp(p.car,x))return K(p);} -return K(false);};___assoc=t1654;var t1655=function(K){SPOCK.count(arguments,'%+');var len=arguments.length;switch(len){case 1:return K(0);case 2:return K(SPOCK.check(arguments[1],'number','+'));default:var p=SPOCK.check(arguments[1],'number','+');for(var i=2;i<len;++i){p+=SPOCK.check(arguments[i],'number','+');} -return K(p);}};____25_2b=t1655;var t1656=function(K){SPOCK.count(arguments,'%-');var len=arguments.length;switch(len){case 1:SPOCK.error('(-) bad argument count',len);case 2:return K(-SPOCK.check(arguments[1],'number','-'));default:var p=SPOCK.check(arguments[1],'number','-');for(var i=2;i<len;++i){p-=SPOCK.check(arguments[i],'number','-');} -return K(p);}};____25_2d=t1656;var t1657=function(K){SPOCK.count(arguments,'%*');var len=arguments.length;switch(len){case 1:return K(1);case 2:return K(SPOCK.check(arguments[1],'number','*'));default:var p=SPOCK.check(arguments[1],'number','*');for(var i=2;i<len;++i){p*=SPOCK.check(arguments[i],'number','*');} -return K(p);}};____25_2a=t1657;var t1658=function(K){SPOCK.count(arguments,'%/');var len=arguments.length;switch(len){case 1:SPOCK.error('(/) bad argument count',len);case 2:return K(1/SPOCK.check(arguments[1],'number','/'));default:var p=SPOCK.check(arguments[1],'number','/');for(var i=2;i<len;++i){p/=SPOCK.check(arguments[i],'number','/');} -return K(p);}};____25_2f=t1658;var t1659=function(K){SPOCK.count(arguments,'%=');var argc=arguments.length;var last=SPOCK.check(arguments[1],'number','=');for(var i=2;i<argc;++i){var x=SPOCK.check(arguments[i],'number','=');if(last!==x)return K(false);else last=x;} -return K(true);};____25_3d=t1659;var t1660=function(K){SPOCK.count(arguments,'%>');var argc=arguments.length;var last=SPOCK.check(arguments[1],'number','>');for(var i=2;i<argc;++i){var x=SPOCK.check(arguments[i],'number','>');if(last<=x)return K(false);else last=x;} -return K(true);};____25_3e=t1660;var t1661=function(K){SPOCK.count(arguments,'%<');var argc=arguments.length;var last=SPOCK.check(arguments[1],'number','<');for(var i=2;i<argc;++i){var x=SPOCK.check(arguments[i],'number','<');if(last>=x)return K(false);else last=x;} -return K(true);};____25_3c=t1661;var t1662=function(K){SPOCK.count(arguments,'%>=');var argc=arguments.length;var last=SPOCK.check(arguments[1],'number','>=');for(var i=2;i<argc;++i){var x=SPOCK.check(arguments[i],'number','>=');if(last<x)return K(false);else last=x;} -return K(true);};____25_3e_3d=t1662;var t1663=function(K){SPOCK.count(arguments,'%<=');var argc=arguments.length;var last=SPOCK.check(arguments[1],'number','<=');for(var i=2;i<argc;++i){var x=SPOCK.check(arguments[i],'number','<=');if(last>x)return K(false);else last=x;} -return K(true);};____25_3c_3d=t1663;var t1664=function(K){SPOCK.count(arguments,'%max');var argc=arguments.length;var n=SPOCK.check(arguments[1],'number','max');for(var i=2;i<argc;++i){var x=SPOCK.check(arguments[i],'number','max');if(n<x)n=x;} -return K(n);};____25max=t1664;var t1665=function(K){SPOCK.count(arguments,'%min');var argc=arguments.length;var n=SPOCK.check(arguments[1],'number','max');for(var i=2;i<argc;++i){var x=SPOCK.check(arguments[i],'number','max');if(n>x)n=x;} -return K(n);};____25min=t1665;var t1666=function(k1106,t264,t265){var r=SPOCK.count(arguments,"modulo");if(r)return r;loop:while(true){var t1668=SPOCK.check(t264,'number',"modulo");var t1669=SPOCK.check(t265,'number',"modulo");var t1667=(t1668)/(t1669);var t275=t1667;var t1670=SPOCK.check(t275,'number',"modulo");var t1672=(t275)<0;var t1671;if(t1672!==false){var t1673=Math.ceil(t275);t1671=t1673;} -else{var t1674=Math.floor(t275);t1671=t1674;} -var t271=t1671;var t1676=SPOCK.check(t271,'number',"modulo");var t1677=SPOCK.check(t265,'number',"modulo");var t1675=(t1676)*(t1677);var t270=t1675;var t1679=SPOCK.check(t264,'number',"modulo");var t1680=SPOCK.check(t270,'number',"modulo");var t1678=(t1679)-(t1680);var t266=t1678;var t1682=SPOCK.check(t265,'number',"modulo");var t1683=SPOCK.check(0,'number',"modulo");var t1681=(t1682)<(t1683);var t952=t1681;var t1684;if(t952!==false){var t1686=SPOCK.check(t266,'number',"modulo");var t1687=SPOCK.check(0,'number',"modulo");var t1685=(t1686)<=(t1687);var t953=t1685;var t1688;if(t953!==false){t1688=t266;} -else{var t1690=SPOCK.check(t266,'number',"modulo");var t1691=SPOCK.check(t265,'number',"modulo");var t1689=(t1690)+(t1691);t1688=t1689;} -t1684=t1688;} -else{var t1693=SPOCK.check(t266,'number',"modulo");var t1694=SPOCK.check(0,'number',"modulo");var t1692=(t1693)>=(t1694);var t954=t1692;var t1695;if(t954!==false){t1695=t266;} -else{var t1697=SPOCK.check(t266,'number',"modulo");var t1698=SPOCK.check(t265,'number',"modulo");var t1696=(t1697)+(t1698);t1695=t1696;} -t1684=t1695;} -return k1106(t1684);}};___modulo=t1666;var t1700=function(k1107,t289,t290){var r=SPOCK.count(arguments,"t288");if(r)return r;loop:while(true){var t1702=SPOCK.check(t289,'number',"t288");var t1703=SPOCK.check(t290,'number',"t288");var t1701=(t1702)/(t1703);var t297=t1701;var t1704=SPOCK.check(t297,'number',"t288");var t1706=(t297)<0;var t1705;if(t1706!==false){var t1707=Math.ceil(t297);t1705=t1707;} -else{var t1708=Math.floor(t297);t1705=t1708;} -var t293=t1705;var t1710=SPOCK.check(t293,'number',"t288");var t1711=SPOCK.check(t290,'number',"t288");var t1709=(t1710)*(t1711);var t292=t1709;var t1713=SPOCK.check(t289,'number',"t288");var t1714=SPOCK.check(t292,'number',"t288");var t1712=(t1713)-(t1714);return k1107(t1712);}};var t288=t1700;var t1716=function(k1108,t300,t301){var r=SPOCK.count(arguments,"t288");if(r)return r;var t302=undefined;var t1717=function(k1109,t303,t304){var r=SPOCK.count(arguments,"t302");if(r)return r;var t1718=SPOCK.check(t304,'number',"t302");var t307=t1718;var t1719=(0)===(t307);var t955=t1719;var t1720;if(t955!==false){var t1722=SPOCK.check(t303,'number',"t302");var t1721=Math.abs(t1722);return k1109(t1721);} -else{var t1724=function(t1110){return t302(k1109,t304,t1110);};return t288(t1724,t303,t304);}};t302=t1717;return t302(k1108,t300,t301);};____25gcd=t1716;var t1728=function(k1111,t309){var t309=SPOCK.rest(arguments,1,'gcd');var t1730=null;var t1729=(t309)===(t1730);var t956=t1729;var t1731;if(t956!==false){return k1111(0);} -else{var t313=undefined;var t1733=function(k1112,t314,t315){var r=SPOCK.count(arguments,"t313");if(r)return r;var t1734=t314.car;var t316=t1734;var t1735=t314.cdr;var t317=t1735;var t1736;if(t315!==false){var t1737=SPOCK.check(t316,'number',"t313");t1736=t1737;} -else{} -var t1739=null;var t1738=(t317)===(t1739);var t957=t1738;var t1740;if(t957!==false){var t1742=SPOCK.check(t316,'number',"t313");var t1741=Math.abs(t1742);return k1112(t1741);} -else{var t1744=t317.car;var t324=t1744;var t1745=SPOCK.check(t324,'number',"t313");var t1746=function(t1114){var t326=t1114;var t1747=t317.cdr;var t327=t1747;var t1748=new SPOCK.Pair(t326,t327);var t1113=t1748;return t313(k1112,t1113,false);};return ____25gcd(t1746,t316,t324);}};t313=t1733;return t313(k1111,t309,true);}};___gcd=t1728;var t1752=function(k1115,t329,t330){var r=SPOCK.count(arguments,"%lcm");if(r)return r;var t1754=SPOCK.check(t329,'number',"%lcm");var t1755=SPOCK.check(t330,'number',"%lcm");var t1753=(t1754)*(t1755);var t331=t1753;var t1756=function(t1116){var t332=t1116;var t1758=SPOCK.check(t331,'number');var t1759=SPOCK.check(t332,'number');var t1757=(t1758)/(t1759);var t335=t1757;var t1760=SPOCK.check(t335,'number');var t1762=(t335)<0;var t1761;if(t1762!==false){var t1763=Math.ceil(t335);t1761=t1763;} -else{var t1764=Math.floor(t335);t1761=t1764;} -return k1115(t1761);};return ____25gcd(t1756,t329,t330);};____25lcm=t1752;var t1767=function(k1117,t338){var t338=SPOCK.rest(arguments,1,'lcm');var t1769=null;var t1768=(t338)===(t1769);var t958=t1768;var t1770;if(t958!==false){return k1117(1);} -else{var t342=undefined;var t1772=function(k1118,t343,t344){var r=SPOCK.count(arguments,"t342");if(r)return r;var t1773=t343.car;var t345=t1773;var t1774=t343.cdr;var t346=t1774;var t1775;if(t344!==false){var t1776=SPOCK.check(t345,'number',"t342");t1775=t1776;} -else{} -var t1778=null;var t1777=(t346)===(t1778);var t959=t1777;var t1779;if(t959!==false){var t1781=SPOCK.check(t345,'number',"t342");var t1780=Math.abs(t1781);return k1118(t1780);} -else{var t1783=t346.car;var t353=t1783;var t1784=SPOCK.check(t353,'number',"t342");var t1785=function(t1120){var t355=t1120;var t1786=t346.cdr;var t356=t1786;var t1787=new SPOCK.Pair(t355,t356);var t1119=t1787;return t342(k1118,t1119,false);};return ____25lcm(t1785,t345,t353);}};t342=t1772;return t342(k1117,t338,true);}};___lcm=t1767;var t1791=function(K){SPOCK.count(arguments,'string->symbol');var str=SPOCK.jstring(arguments[1]);return K(SPOCK.intern(str));};___string_2d_3esymbol=t1791;var t1792=function(k1121,t358,t359){var r=SPOCK.count(arguments,"get");if(r)return r;loop:while(true){var t1794=SPOCK.check(t358,SPOCK.Symbol,"get");var t1796=SPOCK.check(t359,SPOCK.Symbol,"get");var t1795=t1796.name;var t1793=(t1794).plist[(t1795)];var t360=t1793;var t1797=t360===undefined;var t361=t1797;var t1798;if(t361!==false){t1798=false;} -else{t1798=true;} -var t960=t1798;var t1799;if(t960!==false){t1799=t360;} -else{t1799=false;} -return k1121(t1799);}};___get=t1792;var t1801=function(k1122,t363,t364,t365){var r=SPOCK.count(arguments,"put!");if(r)return r;loop:while(true){var t1803=SPOCK.check(t363,SPOCK.Symbol,"put!");var t1805=SPOCK.check(t364,SPOCK.Symbol,"put!");var t1804=t1805.name;var t1802=(t1803).plist[(t1804)]=(t365);return k1122(t1802);}};___put_21=t1801;var t1807=function(K){SPOCK.count(arguments,'string-append');var args=Array.prototype.slice.call(arguments,1);var strs=SPOCK.map(function(x){return SPOCK.jstring(x);},args);return K(new SPOCK.String(strs));};___string_2dappend=t1807;var t1808=function(K){SPOCK.count(arguments,'string');var str=[];var len=arguments.length-1;for(var i=1;i<=len;++i){var x=arguments[i];if(x instanceof SPOCK.Char)str.push(x.character);else SPOCK.error('bad argument type - not a character',x);} -return K(new SPOCK.String(str.join('')));};___string=t1808;var t1809=function(K){SPOCK.count(arguments,'string->list');var str=SPOCK.jstring(arguments[1]);var lst=null;var len=str.length;for(var i=len-1;i>=0;--i) -lst=new SPOCK.Pair(new SPOCK.Char(str.charAt(i)),lst);return K(lst);};___string_2d_3elist=t1809;var t1810=function(K){SPOCK.count(arguments,'list->string');var lst=arguments[1];var str=[];while(lst instanceof SPOCK.Pair){str.push(SPOCK.check(lst.car,SPOCK.Char).character);lst=lst.cdr;} -return K(new SPOCK.String(str.join('')));};___list_2d_3estring=t1810;var t1811=function(K){SPOCK.count(arguments,'make-string');var n=SPOCK.check(arguments[1],'number','make-string');var c=arguments[2];var a=new Array(n);if(c!==undefined) -c=SPOCK.check(c,SPOCK.Char,'make-string').character;else c=' ';for(var i=0;i<n;++i)a[i]=c;return K(new SPOCK.String(a.join('')));};___make_2dstring=t1811;var t1812=function(K){SPOCK.count(arguments,'string-ref');var str=arguments[1];var i=SPOCK.check(arguments[2],'number','string-ref');if(typeof str==='string') -return K(new SPOCK.Char(str.charAt(i)));else if(str instanceof SPOCK.String){var parts=str.parts;for(var p in parts){var l=parts[p].length;if(i<=l)return K(new SPOCK.Char(parts[p].charAt(i)));else i-=l;} -SPOCK.error('`string-ref\' out of range',str,i);}};___string_2dref=t1812;var t1813=function(K){SPOCK.count(arguments,'string-set!');var str=arguments[1];var i=SPOCK.check(arguments[2],'number','string-set!');var c=SPOCK.check(arguments[3],SPOCK.Char,'string-set!');if(typeof str==='string') -SPOCK.error('argument to `string-set!\' is not a mutable string',str);else if(str instanceof SPOCK.String){var parts=str.parts;for(var p in parts){var part=parts[p];var l=part.length;if(i<=l){parts[p]=part.substring(0,i)+c.character+part.substring(i+1);return K(undefined);}else i-=l;} -SPOCK.error('`string-set!\' out of range',str,i);}};___string_2dset_21=t1813;var t1814=function(k1123,t366,t367,t368){var r=SPOCK.count(arguments,"string-copy");if(r)return r;loop:while(true){var t1815=SPOCK.jstring(t366);var t369=t1815;var t1816=t367===undefined;var t961=t1816;var t1817;if(t961!==false){t1817=0;} -else{var t1818=SPOCK.check(t367,'number',"string-copy");t1817=t1818;} -var t371=t1817;var t1819=t368===undefined;var t962=t1819;var t1820;if(t962!==false){var t1821=t369.length;t1820=t1821;} -else{var t1822=SPOCK.check(t368,'number',"string-copy");t1820=t1822;} -var t373=t1820;var t1823=t369.slice(t371,t373);var t375=t1823;var t1824=new SPOCK.String(t375);return k1123(t1824);}};___string_2dcopy=t1814;var t1826=function(k1124,t376,t377,t378,t379){var r=SPOCK.count(arguments,"string-fill!");if(r)return r;var t1827=(t376)instanceof SPOCK.String;var t380=t1827;var t1828;if(t380!==false){t1828=false;} -else{t1828=true;} -var t963=t1828;var t1829=function(t1125){var t1830=t376.normalize();var t381=t1830;var t1831=SPOCK.check(t377,SPOCK.Char,"t1126");var t382=t1831;var t1832=t378===undefined;var t964=t1832;var t1833;if(t964!==false){t1833=0;} -else{var t1834=SPOCK.check(t378,'number',"t1126");t1833=t1834;} -var t383=t1833;var t1835=t379===undefined;var t965=t1835;var t1836;if(t965!==false){var t1837=t381.length;t1836=t1837;} -else{var t1838=SPOCK.check(t379,'number',"t1126");t1836=t1838;} -var t385=t1836;var t1839=function(K){SPOCK.count(arguments);var str=arguments[1];var from=arguments[2];var to=arguments[3];var c=arguments[4];var snew=new Array(to-from);for(var i in snew)snew[i]=c;str.parts=[str.parts[0].substring(0,from),snew.join(''),str.parts[0].substring(to)];return K(str);};return t1839(k1124,t376,t383,t385,t382);};var t1126=t1829;var t1841;if(t963!==false){return ____25error(t1126,"bad argument type - not a mutable string",t376);} -else{return t1126(undefined);}};___string_2dfill_21=t1826;var t1844=function(K){SPOCK.count(arguments,'vector');return K(Array.prototype.slice.call(arguments,1));};___vector=t1844;var t1845=function(K){SPOCK.count(arguments,'make-vector');var n=SPOCK.check(arguments[1],'number','make-vector');var x=arguments[2];var a=new Array(n);if(x!==undefined){for(var i=0;i<n;++i)a[i]=x;} -return K(a);};___make_2dvector=t1845;var t1846=function(K){SPOCK.count(arguments,'vector->list');var vec=SPOCK.check(arguments[1],Array,'vector->list');var lst=null;var len=vec.length;for(var i=len-1;i>=0;--i) -lst=new SPOCK.Pair(vec[i],lst);return K(lst);};___vector_2d_3elist=t1846;var t1847=function(K){SPOCK.count(arguments,'list->vector');var lst=arguments[1];var vec=[];while(lst instanceof SPOCK.Pair){vec.push(lst.car);lst=lst.cdr;} -return K(vec);};___list_2d_3evector=t1847;var t1848=function(K){SPOCK.count(arguments,'vector-fill!');var vec=SPOCK.check(arguments[1],Array,'vector-fill!');var x=arguments[2];var from=arguments[3];var to=arguments[4];if(from===undefined)from=0;if(to===undefined)to=vec.length;for(var i=from;i<to;++i) -vec[i]=x;return K(undefined);};___vector_2dfill_21=t1848;var t1849=function(K){SPOCK.count(arguments,'string->number');var str=SPOCK.jstring(arguments[1]);var base=arguments[2];if(!base)base=10;else base=SPOCK.check(base,'number','string->number');var m=true,neg=1;while(m){m=str.match(/^#[eboxid]/);if(m){switch(str[1]){case'e':case'i':break;case'd':base=10;break;case'o':base=8;break;case'x':base=16;break;case'b':base=2;break;default:return K(false);} -str=str.substring(2);}} -switch(str[0]){case'-':neg=-1;str=str.substring(1);break;case'+':str=str.substring(1);} -var num,den=false;if((m=str.match(/^([^\/]+)\/(.+)$/))){str=m[1];den=m[2];} -function num3(s){var tr=null;switch(base){case 2:tr=/^[0-1]+$/;break;case 8:tr=/^[0-7]+$/;break;case 10:tr=/^[#0-9]*\.?[#0-9]+([esdfl][-+]?[0-9]+)?$/;break;case 16:tr=/^[0-9a-fA-F]+$/;} -if(tr&&!s.match(tr))return false;var s2=s.replace(/#/g,'0');if(base===10)s2=parseFloat(s2.replace(/[esdfl]/g,'e'));else if(s2!==s)return false;else s2=parseInt(s2,base);return isNaN(s2)?false:s2;} -if((num=num3(str))===false)return K(false);if(den&&!(den=num3(den)))return K(false);return K(neg*num/(den||1));};___string_2d_3enumber=t1849;var t1850=function(K){SPOCK.count(arguments,'%show');arguments[2].write(arguments[1]);return K(undefined);};____25show=t1850;var t1851=function(K){SPOCK.count(arguments,'%fetch');return K(arguments[2].read(arguments[1]));};____25fetch=t1851;var t1852=function(K){SPOCK.count(arguments,'%check-port');var port=arguments[1];var dir=arguments[2];if(port instanceof SPOCK.Port){if(port.closed) -SPOCK.error('port is already closed',port);else if(port.direction!==dir) -SPOCK.error('bad argument type - not an '+dir+' port',port,arguments[3]);} -else SPOCK.error('bad argument type - not a port',port,arguments[3]);return K(port);};____25check_2dport=t1852;var t1853=function(k1127,t387){var r=SPOCK.count(arguments,"newline");if(r)return r;var t1854=t387===undefined;var t966=t1854;var t1855=function(t1128){return ____25show(k1127,"\n",t1128);};var t1129=t1855;var t1857;if(t966!==false){return t1129(SPOCK.stdout);} -else{return ____25check_2dport(t1129,t387,"output","newline");}};___newline=t1853;var t1860=function(k1130,t389){var r=SPOCK.count(arguments,"read-char");if(r)return r;var t1861=t389===undefined;var t967=t1861;var t1862=function(t1132){var t1863=function(t1131){var t390=t1131;var t394=SPOCK.EOF;var t1864=(t390)===(t394);var t968=t1864;var t1865;if(t968!==false){t1865=t390;} -else{var t1866=new SPOCK.Char(t390);t1865=t1866;} -return k1130(t1865);};return ____25fetch(t1863,1,t1132);};var t1133=t1862;var t1869;if(t967!==false){return t1133(SPOCK.stdin);} -else{return ____25check_2dport(t1133,t389,"input","read-char");}};___read_2dchar=t1860;var t1872=function(k1134,t395,t396){var r=SPOCK.count(arguments,"write-char");if(r)return r;var t1873=t396===undefined;var t969=t1873;var t1874=function(t1135){var t1876=SPOCK.check(t395,SPOCK.Char,"t1136");var t1875=t1876.character;return ____25show(k1134,t1875,t1135);};var t1136=t1874;var t1878;if(t969!==false){return t1136(SPOCK.stdout);} -else{return ____25check_2dport(t1136,t396,"output","write-char");}};___write_2dchar=t1872;var t398=___read_2dchar;var t1881=function(k1137,t399){var r=SPOCK.count(arguments,"t398");if(r)return r;var t1882=function(t1138){var t400=t1138;var t404=SPOCK.EOF;var t1883=(t400)===(t404);var t401=t1883;var t1884;if(t401!==false){t1884=false;} -else{t1884=true;} -var t970=t1884;var t1885;if(t970!==false){var t1887=t400.character;var t1886=(t399).peeked=(t1887);t1885=t1886;} -else{} -return k1137(t400);};return t398(t1882,t399);};___peek_2dchar=t1881;var t1890=function(k1139,t405){var r=SPOCK.count(arguments,"char-ready?");if(r)return r;var t1891=function(t1140){var t1892=t405.ready();return k1139(t1892);};return ____25check_2dport(t1891,t405,"input","char-ready?");};___char_2dready_3f=t1890;var t1895=function(k1141,t406,t407,t408){var r=SPOCK.count(arguments,"%print-hook");if(r)return r;return ____25show(k1141,"#<unknown object>",t407);};____25print_2dhook=t1895;var t1897=function(k1142,t409,t410){var r=SPOCK.count(arguments,"display");if(r)return r;var t1898=t410===undefined;var t971=t1898;var t1899=function(t1143){var t411=t1143;var t413=undefined;var t1900=function(k1144,t414){var r=SPOCK.count(arguments,"t413");if(r)return r;var t1902=null;var t1901=(t414)===(t1902);var t972=t1901;var t1903;if(t972!==false){return ____25show(k1144,"()",t411);} -else{var t1905=typeof(t414);var t419=t1905;var t1906=(t419)===("number");var t973=t1906;var t1907;if(t973!==false){var t1910=SPOCK.check(t414,'number',"t413");var t1911=undefined===undefined;var t974=t1911;var t1912;if(t974!==false){t1912=10;} -else{var t1913=SPOCK.check(undefined,'number',"t413");t1912=t1913;} -var t1909=t1910.toString(t1912);var t1908=new SPOCK.String(t1909);var t421=t1908;var t1914=SPOCK.jstring(t421);return ____25show(k1144,t1914,t411);} -else{var t1916=typeof(t414);var t427=t1916;var t1917=(t427)===("string");var t426=t1917;var t1918;if(t426!==false){t1918=t426;} -else{var t1919=(t414)instanceof SPOCK.String;t1918=t1919;} -var t975=t1918;var t1920;if(t975!==false){var t1921=SPOCK.jstring(t414);return ____25show(k1144,t1921,t411);} -else{var t1923=(t414)instanceof SPOCK.Symbol;var t976=t1923;var t1924;if(t976!==false){var t1925=t414.name;return ____25show(k1144,t1925,t411);} -else{var t1927=(t414)instanceof SPOCK.Char;var t977=t1927;var t1928;if(t977!==false){var t1929=t414.character;return ____25show(k1144,t1929,t411);} -else{var t433=SPOCK.EOF;var t1931=(t414)===(t433);var t978=t1931;var t1932;if(t978!==false){return ____25show(k1144,"#<eof>",t411);} -else{var t1934=typeof(t414);var t435=t1934;var t1935=(t435)===("function");var t979=t1935;var t1936;if(t979!==false){return ____25show(k1144,"#<procedure>",t411);} -else{var t1938=(t414)===(true);var t438=t1938;var t1939;if(t438!==false){t1939=t438;} -else{var t1940=(t414)===(false);t1939=t1940;} -var t980=t1939;var t1941;if(t980!==false){var t1942;if(t414!==false){t1942="#t";} -else{t1942="#f";} -return ____25show(k1144,t1942,t411);} -else{var t1944=(t414)instanceof SPOCK.Pair;var t981=t1944;var t1945;if(t981!==false){var t1946=function(t1145){var t444=undefined;var t1947=function(k1146,t445){var r=SPOCK.count(arguments,"t444");if(r)return r;var t1949=null;var t1948=(t445)===(t1949);var t982=t1948;var t1950;if(t982!==false){return ____25show(k1146,")",t411);} -else{var t1952=(t445)instanceof SPOCK.Pair;var t449=t1952;var t1953;if(t449!==false){t1953=false;} -else{t1953=true;} -var t983=t1953;var t1954;if(t983!==false){var t1955=function(t1147){var t1956=function(t1148){return ____25show(k1146,")",t411);};return t413(t1956,t445);};return ____25show(t1955," . ",t411);} -else{var t452=t414;var t1960=(t452)===(t445);var t451=t1960;var t1961;if(t451!==false){t1961=false;} -else{t1961=true;} -var t984=t1961;var t1962=function(t1149){var t1963=function(t1150){var t1964=SPOCK.check(t445,SPOCK.Pair);var t456=t1964;var t1965=t456.cdr;return t444(k1146,t1965);};var t1967=t445.car;return t413(t1963,t1967);};var t1151=t1962;var t1969;if(t984!==false){return ____25show(t1151," ",t411);} -else{return t1151(undefined);} -t1954=t1969;} -t1950=t1954;}};t444=t1947;return t444(k1144,t414);};return ____25show(t1946,"(",t411);} -else{var t1974=t414===undefined;var t985=t1974;var t1975;if(t985!==false){return ____25show(k1144,"#<undefined>",t411);} -else{var t1977=(t414)instanceof Array;var t986=t1977;var t1978;if(t986!==false){var t1979=t414.length;var t459=t1979;var t1980=function(t1152){var t460=undefined;var t1981=function(k1153,t461){var r=SPOCK.count(arguments,"t460");if(r)return r;var t1983=(t461)>=(t459);var t1982;if(t1983!==false){return ____25show(k1153,")",t411);} -else{var t1985=(t461)===(0);var t462=t1985;var t1986;if(t462!==false){t1986=false;} -else{t1986=true;} -var t987=t1986;var t1987=function(t1154){var t1988=function(t1155){var t1989=1+(t461);return t460(k1153,t1989);};var t1991=(t414)[(t461)];return t413(t1988,t1991);};var t1156=t1987;var t1993;if(t987!==false){return ____25show(t1156," ",t411);} -else{return t1156(undefined);} -t1982=t1993;}};t460=t1981;return t460(k1144,0);};return ____25show(t1980,"#(",t411);} -else{var t1999=(t414)instanceof SPOCK.Port;var t1998;if(t1999!==false){var t2000=SPOCK.stringify(t414);return ____25show(k1144,t2000,t411);} -else{var t2003=(t414)instanceof SPOCK.Promise;var t2002;if(t2003!==false){return ____25show(k1144,"#<promise>",t411);} -else{var t2005=typeof(t414);var t466=t2005;var t2006=("object")===(t466);var t988=t2006;var t2007;if(t988!==false){return ____25print_2dhook(k1144,t414,t411,false);} -else{return ____25show(k1144,"#<unknown object>",t411);} -t2002=t2007;} -t1998=t2002;} -t1978=t1998;} -t1975=t1978;} -t1945=t1975;} -t1941=t1945;} -t1936=t1941;} -t1932=t1936;} -t1928=t1932;} -t1924=t1928;} -t1920=t1924;} -t1907=t1920;} -t1903=t1907;}};t413=t1900;return t413(k1142,t409);};var t1157=t1899;var t2011;if(t971!==false){return t1157(SPOCK.stdout);} -else{return ____25check_2dport(t1157,t410,"output","display");}};___display=t1897;var t467=___display;var t468=undefined;var t2014=function(K){SPOCK.count(arguments,'t468');var str=arguments[1];var a=[];var len=str.length;for(var i=0;i<len;++i){var c=str.charAt(i);switch(c){case'\n':a.push('\n');break;case'\t':a.push('\t');break;case'\r':a.push('\r');break;case'\"':a.push('\\"');break;case'\\':a.push('\\');break;default:a.push(c);}} -return K(a.join(''));};t468=t2014;var t2015=function(k1158,t469,t470){var r=SPOCK.count(arguments);if(r)return r;var t2016=t470===undefined;var t989=t2016;var t2017=function(t1159){var t471=t1159;var t473=undefined;var t2018=function(k1160,t474){var r=SPOCK.count(arguments,"t473");if(r)return r;var t2019=typeof(t474);var t477=t2019;var t2020=(t477)===("string");var t476=t2020;var t2021;if(t476!==false){t2021=t476;} -else{var t2022=(t474)instanceof SPOCK.String;t2021=t2022;} -var t990=t2021;var t2023;if(t990!==false){var t2024=function(t1161){var t2025=function(t1163){var t2026=function(t1162){return ____25show(k1160,"\"",t471);};return ____25show(t2026,t1163,t471);};var t2029=SPOCK.jstring(t474);return t468(t2025,t2029);};return ____25show(t2024,"\"",t471);} -else{var t2032=(t474)instanceof SPOCK.Char;var t991=t2032;var t2033;if(t991!==false){var t2034=function(t1164){var t2035=t474.character;var t480=t2035;var t2037=SPOCK.eqvp(t480,"\n");var t992=t2037;var t2038;if(t992!==false){t2038=true;} -else{t2038=false;} -var t2036;if(t2038!==false){t2036="newline";} -else{var t2040=SPOCK.eqvp(t480,"\r");var t993=t2040;var t2041;if(t993!==false){t2041=true;} -else{t2041=false;} -var t2039;if(t2041!==false){t2039="return";} -else{var t2043=SPOCK.eqvp(t480,"\t");var t994=t2043;var t2044;if(t994!==false){t2044=true;} -else{t2044=false;} -var t2042;if(t2044!==false){t2042="tab";} -else{var t2046=SPOCK.eqvp(t480," ");var t995=t2046;var t2047;if(t995!==false){t2047=true;} -else{t2047=false;} -var t2045;if(t2047!==false){t2045="space";} -else{t2045=t480;} -t2042=t2045;} -t2039=t2042;} -t2036=t2039;} -return ____25show(k1160,t2036,t471);};return ____25show(t2034,"#\\",t471);} -else{var t2050=(t474)instanceof SPOCK.Pair;var t996=t2050;var t2051;if(t996!==false){var t2052=function(t1165){var t491=undefined;var t2053=function(k1166,t492){var r=SPOCK.count(arguments,"t491");if(r)return r;var t2055=null;var t2054=(t492)===(t2055);var t997=t2054;var t2056;if(t997!==false){return ____25show(k1166,")",t471);} -else{var t2058=(t492)instanceof SPOCK.Pair;var t496=t2058;var t2059;if(t496!==false){t2059=false;} -else{t2059=true;} -var t998=t2059;var t2060;if(t998!==false){var t2061=function(t1167){var t2062=function(t1168){return ____25show(k1166,")",t471);};return t473(t2062,t492);};return ____25show(t2061," . ",t471);} -else{var t499=t474;var t2066=(t499)===(t492);var t498=t2066;var t2067;if(t498!==false){t2067=false;} -else{t2067=true;} -var t999=t2067;var t2068=function(t1169){var t2069=function(t1170){var t2070=SPOCK.check(t492,SPOCK.Pair);var t503=t2070;var t2071=t503.cdr;return t491(k1166,t2071);};var t2073=t492.car;return t473(t2069,t2073);};var t1171=t2068;var t2075;if(t999!==false){return ____25show(t1171," ",t471);} -else{return t1171(undefined);} -t2060=t2075;} -t2056=t2060;}};t491=t2053;return t491(k1160,t474);};return ____25show(t2052,"(",t471);} -else{var t2080=(t474)instanceof Array;var t1000=t2080;var t2081;if(t1000!==false){var t2082=t474.length;var t505=t2082;var t2083=function(t1172){var t506=undefined;var t2084=function(k1173,t507){var r=SPOCK.count(arguments,"t506");if(r)return r;var t2086=(t507)>=(t505);var t2085;if(t2086!==false){return ____25show(k1173,")",t471);} -else{var t2088=(t507)===(0);var t508=t2088;var t2089;if(t508!==false){t2089=false;} -else{t2089=true;} -var t1001=t2089;var t2090=function(t1174){var t2091=function(t1175){var t2092=1+(t507);return t506(k1173,t2092);};var t2094=(t474)[(t507)];return t473(t2091,t2094);};var t1176=t2090;var t2096;if(t1001!==false){return ____25show(t1176," ",t471);} -else{return t1176(undefined);} -t2085=t2096;}};t506=t2084;return t506(k1160,0);};return ____25show(t2083,"#(",t471);} -else{return t467(k1160,t474,t471);} -t2051=t2081;} -t2033=t2051;} -t2023=t2033;}};t473=t2018;return t473(k1158,t469);};var t1177=t2017;var t2103;if(t989!==false){return t1177(SPOCK.stdout);} -else{return ____25check_2dport(t1177,t470,"output","write");}};___write=t2015;var t2106=function(K){SPOCK.count(arguments,'apply');var proc=arguments[1];var argc=arguments.length;var lst=arguments[argc-1];var vec=[K].concat(Array.prototype.slice.call(arguments,2,argc-1));if(lst instanceof Array)vec=vec.concat(lst);else{var len=SPOCK.length(lst);var vec2=new Array(len);for(var i=0;lst instanceof SPOCK.Pair;lst=lst.cdr) -vec2[i++]=lst.car;vec=vec.concat(vec2);} -return proc.apply(SPOCK.global,vec);};___apply=t2106;var t2107=function(k1178,t511,t512,t513){var r=SPOCK.count(arguments,"for-each");if(r)return r;var t513=SPOCK.rest(arguments,3,'for-each');var t2109=null;var t2108=(t513)===(t2109);var t1002=t2108;var t2110;if(t1002!==false){var t2111=(t512)instanceof Array;var t1003=t2111;var t2112;if(t1003!==false){var t2114=SPOCK.check(t512,Array,"for-each");var t2113=t2114.length;var t518=t2113;var t520=undefined;var t2115=function(k1179,t521){var r=SPOCK.count(arguments,"t520");if(r)return r;var t523=t518;var t2117=SPOCK.check(t521,'number',"t520");var t2118=SPOCK.check(t523,'number',"t520");var t2116=(t2117)>=(t2118);var t1004=t2116;var t2119;if(t1004!==false){return k1179(false);} -else{var t2121=function(t1180){var t2123=SPOCK.check(t521,'number');var t2124=SPOCK.check(1,'number');var t2122=(t2123)+(t2124);return t520(k1179,t2122);};var t524=t512;var t2127=SPOCK.check(t524,Array,"t520");var t2128=SPOCK.check(t521,'number',"t520");var t2126=(t2127)[(t2128)];return t511(t2121,t2126);}};t520=t2115;return t520(k1178,0);} -else{var t528=undefined;var t2131=function(k1181,t529){var r=SPOCK.count(arguments,"t528");if(r)return r;var t2132=(t529)instanceof SPOCK.Pair;var t1005=t2132;var t2133;if(t1005!==false){var t2134=function(t1182){var t2135=t529.cdr;return t528(k1181,t2135);};var t2137=t529.car;return t511(t2134,t2137);} -else{return k1181(undefined);}};t528=t2131;return t528(k1178,t512);} -t2110=t2112;} -else{var t533=undefined;var t2141=function(k1183,t534){var r=SPOCK.count(arguments,"t533");if(r)return r;var t536=undefined;var t2142=function(k1189,t537){var r=SPOCK.count(arguments,"t536");if(r)return r;var t2144=null;var t2143=(t537)===(t2144);var t1006=t2143;var t2145;if(t1006!==false){var t2146=null;return k1189(t2146);} -else{var t2148=t537.car;var t541=t2148;var t2149=(t541)instanceof SPOCK.Pair;var t1007=t2149;var t2150;if(t1007!==false){var t2151=t541.car;var t544=t2151;var t2152=function(t1190){var t545=t1190;var t2153=new SPOCK.Pair(t544,t545);return k1189(t2153);};var t2155=t537.cdr;return t536(t2152,t2155);} -else{return k1189(false);} -t2145=t2150;}};t536=t2142;var t2158=function(t1184){var t535=t1184;var t2159;if(t535!==false){var t2160=function(t1185){var t548=undefined;var t2161=function(k1187,t549){var r=SPOCK.count(arguments,"t548");if(r)return r;var t2163=null;var t2162=(t549)===(t2163);var t1008=t2162;var t2164;if(t1008!==false){var t2165=null;return k1187(t2165);} -else{var t2167=t549.car;var t555=t2167;var t2168=t555.cdr;var t553=t2168;var t2169=function(t1188){var t554=t1188;var t2170=new SPOCK.Pair(t553,t554);return k1187(t2170);};var t2172=t549.cdr;return t548(t2169,t2172);}};t548=t2161;var t2174=function(t1186){return t533(k1183,t1186);};return t548(t2174,t534);};return ___apply(t2160,t511,t535);} -else{return k1183(undefined);}};return t536(t2158,t534);};t533=t2141;var t2180=new SPOCK.Pair(t512,t513);return t533(k1178,t2180);}};___for_2deach=t2107;var t2182=function(k1191,t560,t561,t562){var r=SPOCK.count(arguments,"map");if(r)return r;var t562=SPOCK.rest(arguments,3,'map');var t2184=null;var t2183=(t562)===(t2184);var t1009=t2183;var t2185;if(t1009!==false){var t2186=(t561)instanceof Array;var t1010=t2186;var t2187;if(t1010!==false){var t2189=SPOCK.check(t561,Array,"map");var t2188=t2189.length;var t567=t2188;var t2190=function(t1192){var t569=t1192;var t570=undefined;var t2191=function(k1193,t571){var r=SPOCK.count(arguments,"t570");if(r)return r;var t573=t567;var t2193=SPOCK.check(t571,'number',"t570");var t2194=SPOCK.check(t573,'number',"t570");var t2192=(t2193)>=(t2194);var t1011=t2192;var t2195;if(t1011!==false){return k1193(t569);} -else{var t574=t569;var t575=t571;var t2197=function(t1195){var t576=t1195;var t2199=SPOCK.check(t574,Array);var t2200=SPOCK.check(t575,'number');var t2198=(t2199)[(t2200)]=(t576);var t1194=t2198;var t2202=SPOCK.check(t571,'number');var t2203=SPOCK.check(1,'number');var t2201=(t2202)+(t2203);return t570(k1193,t2201);};var t577=t561;var t2206=SPOCK.check(t577,Array,"t570");var t2207=SPOCK.check(t571,'number',"t570");var t2205=(t2206)[(t2207)];return t560(t2197,t2205);}};t570=t2191;return t570(k1191,0);};return ___make_2dvector(t2190,t567);} -else{var t581=undefined;var t2211=function(k1196,t582){var r=SPOCK.count(arguments,"t581");if(r)return r;var t2212=(t582)instanceof SPOCK.Pair;var t1012=t2212;var t2213;if(t1012!==false){var t2214=function(t1197){var t584=t1197;var t2215=function(t1198){var t585=t1198;var t2216=new SPOCK.Pair(t584,t585);return k1196(t2216);};var t2218=t582.cdr;return t581(t2215,t2218);};var t2220=t582.car;return t560(t2214,t2220);} -else{var t2222=null;return k1196(t2222);}};t581=t2211;return t581(k1191,t561);} -t2185=t2187;} -else{var t588=undefined;var t2225=function(k1199,t589){var r=SPOCK.count(arguments,"t588");if(r)return r;var t591=undefined;var t2226=function(k1206,t592){var r=SPOCK.count(arguments,"t591");if(r)return r;var t2228=null;var t2227=(t592)===(t2228);var t1013=t2227;var t2229;if(t1013!==false){var t2230=null;return k1206(t2230);} -else{var t2232=t592.car;var t596=t2232;var t2233=(t596)instanceof SPOCK.Pair;var t1014=t2233;var t2234;if(t1014!==false){var t2235=t596.car;var t599=t2235;var t2236=function(t1207){var t600=t1207;var t2237=new SPOCK.Pair(t599,t600);return k1206(t2237);};var t2239=t592.cdr;return t591(t2236,t2239);} -else{return k1206(false);} -t2229=t2234;}};t591=t2226;var t2242=function(t1200){var t590=t1200;var t2243;if(t590!==false){var t2244=function(t1201){var t603=t1201;var t605=undefined;var t2245=function(k1204,t606){var r=SPOCK.count(arguments,"t605");if(r)return r;var t2247=null;var t2246=(t606)===(t2247);var t1015=t2246;var t2248;if(t1015!==false){var t2249=null;return k1204(t2249);} -else{var t2251=t606.car;var t612=t2251;var t2252=t612.cdr;var t610=t2252;var t2253=function(t1205){var t611=t1205;var t2254=new SPOCK.Pair(t610,t611);return k1204(t2254);};var t2256=t606.cdr;return t605(t2253,t2256);}};t605=t2245;var t2258=function(t1203){var t2259=function(t1202){var t604=t1202;var t2260=new SPOCK.Pair(t603,t604);return k1199(t2260);};return t588(t2259,t1203);};return t605(t2258,t589);};return ___apply(t2244,t560,t590);} -else{var t2265=null;return k1199(t2265);}};return t591(t2242,t589);};t588=t2225;var t2268=new SPOCK.Pair(t561,t562);return t588(k1191,t2268);}};___map=t2182;var t2270=function(k1208,t619,t620,t621){var r=SPOCK.count(arguments);if(r)return r;var t2271=function(t1209){var t2272=new SPOCK.Pair(t619,t621);var t622=t2272;var t623=SPOCK.dynwinds;var t2273=new SPOCK.Pair(t622,t623);SPOCK.dynwinds=t2273 -var t2274=function(k1210){var t626=SPOCK.dynwinds;var t2275=t626.cdr;SPOCK.dynwinds=t2275 -return t621(k1210);};return ____25call_2dwith_2dsaved_2dvalues(k1208,t620,t2274);};return t619(t2271);};___dynamic_2dwind=t2270;var t2279=function(K){SPOCK.count(arguments,'%call-with-current-continuation');var proc=arguments[1];function cont(){return K.apply(SPOCK.global,Array.prototype.slice.call(arguments,1));} -return proc(K,cont);};____25call_2dwith_2dcurrent_2dcontinuation=t2279;var t627=undefined;var t2280=function(k1211,t628,t629){var r=SPOCK.count(arguments,"t627");if(r)return r;var t631=SPOCK.dynwinds;var t2281=(t631)===(t628);var t630=t2281;var t2282;if(t630!==false){return k1211(t630);} -else{var t2285=SPOCK.check(t629,'number',"t627");var t2286=SPOCK.check(0,'number',"t627");var t2284=(t2285)<(t2286);var t1016=t2284;var t2287;if(t1016!==false){var t2288=function(t1212){var t2289=t628.car;var t636=t2289;var t2290=t636.car;var t2291=function(t1213){SPOCK.dynwinds=t628 -return k1211(undefined);};return t2290(t2291);};var t2294=t628.cdr;var t2295=(t629)+1;return t627(t2288,t2294,t2295);} -else{var t640=SPOCK.dynwinds;var t2297=t640.car;var t639=t2297;var t2298=t639.cdr;var t638=t2298;var t641=SPOCK.dynwinds;var t2299=t641.cdr;SPOCK.dynwinds=t2299 -var t2300=function(t1214){var t2301=(t629)-1;return t627(k1211,t628,t2301);};return t638(t2300);} -t2282=t2287;}};t627=t2280;var t2304=function(k1215,t642){var r=SPOCK.count(arguments);if(r)return r;var t643=SPOCK.dynwinds;var t2305=function(k1216,t644){var r=SPOCK.count(arguments);if(r)return r;var t2306=function(k1217,t645){var t645=SPOCK.rest(arguments,1);var t646=SPOCK.dynwinds;var t649=t643;var t2307=(t646)===(t649);var t647=t2307;var t2308;if(t647!==false){t2308=false;} -else{t2308=true;} -var t1017=t2308;var t2309=function(t1218){return ___apply(k1217,t644,t645);};var t1219=t2309;var t2311;if(t1017!==false){var t2312=SPOCK.length(t646);var t650=t2312;var t653=t643;var t2313=SPOCK.length(t653);var t651=t2313;var t2315=SPOCK.check(t650,'number');var t2316=SPOCK.check(t651,'number');var t2314=(t2315)-(t2316);return t627(t1219,t643,t2314);} -else{return t1219(undefined);}};return t642(k1216,t2306);};return ____25call_2dwith_2dcurrent_2dcontinuation(k1215,t2305);};___call_2dwith_2dcurrent_2dcontinuation=t2304;var t2321=function(k1220,t654){var r=SPOCK.count(arguments,"%get-context");if(r)return r;return ___vector(k1220,t654,SPOCK.dynwinds,SPOCK.stdin,SPOCK.stdout,SPOCK.stderr);};____25get_2dcontext=t2321;var t2323=function(K){SPOCK.count(arguments,'%restore-context');var state=arguments[1];SPOCK.dynwinds=state[1];SPOCK.stdin=state[2];SPOCK.stdout=state[3];SPOCK.stderr=state[4];return(state[0])(undefined);};____25restore_2dcontext=t2323;var t2324=function(k1221,t655){var r=SPOCK.count(arguments,"suspend");if(r)return r;var t2325=function(k1222,t656){var r=SPOCK.count(arguments);if(r)return r;var t2326=function(t1224){var t2327=function(t1223){var t2328=function(K){SPOCK.count(arguments);return new SPOCK.Result(undefined);};return t2328(k1222);};return t655(t2327,t1224);};return ____25get_2dcontext(t2326,t656);};return ____25call_2dwith_2dcurrent_2dcontinuation(k1221,t2325);};___suspend=t2324;var t2333=function(k1225,t657){var r=SPOCK.count(arguments,"%make-promise");if(r)return r;var t658=false;var t659=false;var t2335=function(k1226){var t2336;if(t658!==false){return ___apply(k1226,___values,t659);} -else{var t2338=function(k1227,t660){var t660=SPOCK.rest(arguments,1);var t2339;if(t658!==false){return ___apply(k1227,___values,t659);} -else{t658=true;t659=t660;return ___apply(k1227,___values,t659);}};return ___call_2dwith_2dvalues(k1226,t657,t2338);}};var t2334=new SPOCK.Promise(t2335);return k1225(t2334);};____25make_2dpromise=t2333;var t2344=function(k1228,t661){var r=SPOCK.count(arguments,"force");if(r)return r;var t2346=(t661)instanceof SPOCK.Promise;var t2345;if(t2346!==false){var t2347=t661.thunk;return t2347(k1228);} -else{return k1228(t661);}};___force=t2344;var t662=___dynamic_2dwind;var t2350=function(k1229,t663,t664){var r=SPOCK.count(arguments,"t662");if(r)return r;var t2351=function(t1230){var t665=false;var t2352=function(k1231){loop:while(true){t665=SPOCK.stdin;SPOCK.stdin=t663 -return k1231(undefined);}};var t2354=function(k1232){loop:while(true){SPOCK.stdin=t665 -return k1232(undefined);}};return t662(k1229,t2352,t664,t2354);};return ____25check_2dport(t2351,t663,"input","with-input-from-port");};___with_2dinput_2dfrom_2dport=t2350;var t666=___dynamic_2dwind;var t2358=function(k1233,t667,t668){var r=SPOCK.count(arguments,"t666");if(r)return r;var t2359=function(t1234){var t669=false;var t2360=function(k1235){loop:while(true){t669=SPOCK.stdout;SPOCK.stdout=t667 -return k1235(undefined);}};var t2362=function(k1236){loop:while(true){SPOCK.stdout=t669 -return k1236(undefined);}};return t666(k1233,t2360,t668,t2362);};return ____25check_2dport(t2359,t667,"output","with-output-to-port");};___with_2doutput_2dto_2dport=t2358;var t2366=function(K){SPOCK.count(arguments,'%close-port');var port=arguments[1];port.close();port.closed=true;return K(port);};____25close_2dport=t2366;var t2367=function(K){SPOCK.count(arguments,'open-input-file');var fn=SPOCK.check(arguments[1],'string','open-input-file');return K(SPOCK.openInputFile(fn));};___open_2dinput_2dfile=t2367;var t2368=function(K){SPOCK.count(arguments,'open-output-file');var fn=SPOCK.check(arguments[1],'string','open-input-file');var exp=null;if(arguments.length===3) -exp=SPOCK.check(arguments[2],'number','open-input-file');return K(SPOCK.openOutputFile(fn,exp));};___open_2doutput_2dfile=t2368;var t2369=function(k1237,t670){var r=SPOCK.count(arguments,"close-input-port");if(r)return r;var t2370=function(t1238){var t671=t1238;return ____25close_2dport(k1237,t671);};return ____25check_2dport(t2370,t670,"input","close-input-port");};___close_2dinput_2dport=t2369;var t2373=function(k1239,t672){var r=SPOCK.count(arguments,"close-output-port");if(r)return r;var t2374=function(t1240){var t673=t1240;return ____25close_2dport(k1239,t673);};return ____25check_2dport(t2374,t672,"output","close-output-port");};___close_2doutput_2dport=t2373;var t675=___open_2dinput_2dfile;var t2377=function(k1241,t678,t679){var r=SPOCK.count(arguments);if(r)return r;var t2378=function(t1242){var t680=t1242;var t2379=function(k1243){return t679(k1243,t680);};var t2381=function(k1244){return ___close_2dinput_2dport(k1244,t680);};return ____25call_2dwith_2dsaved_2dvalues(k1241,t2379,t2381);};return t675(t2378,t678);};___call_2dwith_2dinput_2dfile=t2377;var t682=___open_2doutput_2dfile;var t2385=function(k1245,t685,t686){var r=SPOCK.count(arguments);if(r)return r;var t2386=function(t1246){var t687=t1246;var t2387=function(k1247){return t686(k1247,t687);};var t2389=function(k1248){return ___close_2doutput_2dport(k1248,t687);};return ____25call_2dwith_2dsaved_2dvalues(k1245,t2387,t2389);};return t682(t2386,t685);};___call_2dwith_2doutput_2dfile=t2385;var t688=___with_2dinput_2dfrom_2dport;var t689=___open_2dinput_2dfile;var t693=___close_2dinput_2dport;var t2393=function(k1249,t694,t695){var r=SPOCK.count(arguments,"t693");if(r)return r;var t2394=function(t1250){var t696=t1250;var t2395=function(k1251){var t2396=function(k1252){return t693(k1252,t696);};return ____25call_2dwith_2dsaved_2dvalues(k1251,t695,t2396);};return t688(k1249,t696,t2395);};return t689(t2394,t694);};___with_2dinput_2dfrom_2dfile=t2393;var t697=___with_2doutput_2dto_2dport;var t698=___open_2doutput_2dfile;var t702=___close_2doutput_2dport;var t2401=function(k1253,t703,t704){var r=SPOCK.count(arguments,"t702");if(r)return r;var t2402=function(t1254){var t705=t1254;var t2403=function(k1255){var t2404=function(k1256){return t702(k1256,t705);};return ____25call_2dwith_2dsaved_2dvalues(k1255,t704,t2404);};return t697(k1253,t705,t2403);};return t698(t2402,t703);};___with_2doutput_2dto_2dfile=t2401;var t2409=function(k1257,t706){var r=SPOCK.count(arguments,"open-input-string");if(r)return r;var t707=undefined;var t2410=function(K){SPOCK.count(arguments,'t707');var buffer=arguments[1];var pos=0;var len=buffer.length;function read(n){if(pos>=len)return SPOCK.EOF;var str=buffer.substring(pos,pos+n);pos+=n;return str;} -return K(new SPOCK.Port('input',{read:read}));};t707=t2410;var t2411=SPOCK.jstring(t706);return t707(k1257,t2411);};___open_2dinput_2dstring=t2409;var t2413=function(K){SPOCK.count(arguments,'open-output-string');var buffer=[];function write(s){buffer.push(s);} -var port=new SPOCK.Port('output',{write:write});port.buffer=buffer;port.isStringPort=true;return K(port);};___open_2doutput_2dstring=t2413;var t2414=function(k1258,t709){var r=SPOCK.count(arguments,"get-output-string");if(r)return r;loop:while(true){var t2415=SPOCK.check(t709,SPOCK.Port,"get-output-string");var t710=t2415;var t2416=t710.isStringPort;var t712=t2416;var t2417=t712===undefined;var t711=t2417;var t2418;if(t711!==false){t2418=false;} -else{t2418=true;} -var t1018=t2418;var t2419;if(t1018!==false){var t2421=t710.buffer;var t2420=t2421.join("");var t714=t2420;var t2422=new SPOCK.String(t714);var t713=t2422;var t2423=(t710).buffer=[];t2419=t713;} -else{var t2424=SPOCK.error("bad argument type - not a string port",t710);t2419=t2424;} -return k1258(t2419);}};___get_2doutput_2dstring=t2414;var t2426=function(k1259,t715,t716){var r=SPOCK.count(arguments,"with-input-from-string");if(r)return r;var t2427=function(t1260){var t717=t1260;return ___with_2dinput_2dfrom_2dport(k1259,t717,t716);};return ___open_2dinput_2dstring(t2427,t715);};___with_2dinput_2dfrom_2dstring=t2426;var t2430=function(k1261,t718){var r=SPOCK.count(arguments,"with-output-to-string");if(r)return r;var t2431=function(t1262){var t719=t1262;var t2432=function(t1263){return ___get_2doutput_2dstring(k1261,t719);};return ___with_2doutput_2dto_2dport(t2432,t719,t718);};return ___open_2doutput_2dstring(t2431);};___with_2doutput_2dto_2dstring=t2430;var t720=___read_2dchar;var t721=___reverse;var t722=___peek_2dchar;var t723=___list_2d_3evector;var t724=___list_2d_3estring;var t2436=function(k1264){loop:while(true){return k1264(SPOCK.stdin);}};var t725=t2436;var t726=___string_2d_3enumber;var t2438=function(k1265,t727){var r=SPOCK.count(arguments,"t726");if(r)return r;var t2439=t727===undefined;var t1019=t2439;var t2440=function(t1266){var t728=t1266;var t730=undefined;var t731=undefined;var t732=undefined;var t733=undefined;var t734=undefined;var t735=undefined;var t736=undefined;var t737=undefined;var t2441=function(k1267,t738){var r=SPOCK.count(arguments,"t730");if(r)return r;var t2442=function(t1268){var t739=t1268;var t2443;if(t739!==false){return k1267(t739);} -else{return ___string_2d_3esymbol(k1267,t738);}};return t726(t2442,t738);};t730=t2441;var t2447=function(k1269){var t2448=function(t1270){var t740=t1270;var t743=SPOCK.EOF;var t2449=(t740)===(t743);var t1020=t2449;var t2450;if(t1020!==false){return k1269(t740);} -else{var t744=t740;var t2454=new SPOCK.Char("#");var t2453=SPOCK.eqvp(t740,t2454);var t1021=t2453;var t2455;if(t1021!==false){t2455=true;} -else{t2455=false;} -var t2452;if(t2455!==false){return t734(k1269);} -else{var t2459=new SPOCK.Char("(");var t2458=SPOCK.eqvp(t744,t2459);var t1022=t2458;var t2460;if(t1022!==false){t2460=true;} -else{t2460=false;} -var t2457;if(t2460!==false){var t2461=new SPOCK.Char(")");return t735(k1269,t2461);} -else{var t2465=new SPOCK.Char("[");var t2464=SPOCK.eqvp(t744,t2465);var t1023=t2464;var t2466;if(t1023!==false){t2466=true;} -else{t2466=false;} -var t2463;if(t2466!==false){var t2467=new SPOCK.Char("]");return t735(k1269,t2467);} -else{var t2471=new SPOCK.Char("{");var t2470=SPOCK.eqvp(t744,t2471);var t1024=t2470;var t2472;if(t1024!==false){t2472=true;} -else{t2472=false;} -var t2469;if(t2472!==false){var t2473=new SPOCK.Char("}");return t735(k1269,t2473);} -else{var t2477=new SPOCK.Char(",");var t2476=SPOCK.eqvp(t744,t2477);var t1025=t2476;var t2478;if(t1025!==false){t2478=true;} -else{t2478=false;} -var t2475;if(t2478!==false){var t2479=function(t1271){var t755=t1271;var t2481=new SPOCK.Char("@");var t2480=SPOCK.eqvp(t755,t2481);var t1026=t2480;var t2482;if(t1026!==false){var t2483=function(t1273){var t2484=function(t1272){var t757=t1272;return k1269(t757);};var t2486=SPOCK.intern("unquote-splicing");return ____25list(t2484,t2486,t1273);};return t731(t2483);} -else{var t2489=function(t1275){var t2490=function(t1274){var t758=t1274;return k1269(t758);};var t2492=SPOCK.intern("unquote");return ____25list(t2490,t2492,t1275);};return t731(t2489);}};return t722(t2479,t728);} -else{var t2498=new SPOCK.Char("`");var t2497=SPOCK.eqvp(t744,t2498);var t1027=t2497;var t2499;if(t1027!==false){t2499=true;} -else{t2499=false;} -var t2496;if(t2499!==false){var t2500=function(t1277){var t2501=function(t1276){var t761=t1276;return k1269(t761);};var t2503=SPOCK.intern("quasiquote");return ____25list(t2501,t2503,t1277);};return t731(t2500);} -else{var t2508=new SPOCK.Char("'");var t2507=SPOCK.eqvp(t744,t2508);var t1028=t2507;var t2509;if(t1028!==false){t2509=true;} -else{t2509=false;} -var t2506;if(t2509!==false){var t2510=function(t1279){var t2511=function(t1278){var t764=t1278;return k1269(t764);};var t2513=SPOCK.intern("quote");return ____25list(t2511,t2513,t1279);};return t731(t2510);} -else{var t2518=new SPOCK.Char(";");var t2517=SPOCK.eqvp(t744,t2518);var t1029=t2517;var t2519;if(t1029!==false){t2519=true;} -else{t2519=false;} -var t2516;if(t2519!==false){var t2520=function(t1280){return t731(k1269);};return t732(t2520);} -else{var t2525=new SPOCK.Char("\"");var t2524=SPOCK.eqvp(t744,t2525);var t1030=t2524;var t2526;if(t1030!==false){t2526=true;} -else{t2526=false;} -var t2523;if(t2526!==false){return t736(k1269);} -else{var t2530=new SPOCK.Char(")");var t2529=SPOCK.eqvp(t744,t2530);var t1031=t2529;var t2531;if(t1031!==false){t2531=true;} -else{var t2533=new SPOCK.Char("]");var t2532=SPOCK.eqvp(t744,t2533);var t1032=t2532;var t2534;if(t1032!==false){t2534=true;} -else{var t2536=new SPOCK.Char("}");var t2535=SPOCK.eqvp(t744,t2536);var t1033=t2535;var t2537;if(t1033!==false){t2537=true;} -else{t2537=false;} -t2534=t2537;} -t2531=t2534;} -var t2528;if(t2531!==false){return ____25error(k1269,"unexpected delimiter",t740);} -else{var t2540=SPOCK.check(t740,SPOCK.Char);var t2539=(t2540).character.match(/^\s$/);var t777=t2539;var t2542=null;var t2541=(t777)===(t2542);var t776=t2541;var t2543;if(t776!==false){t2543=false;} -else{t2543=true;} -var t1034=t2543;var t2544;if(t1034!==false){return t731(k1269);} -else{var t2546=function(t1283){var t780=t1283;var t1282=t780;var t2547=function(t1281){return t730(k1269,t1281);};return t737(t2547,t1282);};return ____25list(t2546,t740);} -t2528=t2544;} -t2523=t2528;} -t2516=t2523;} -t2506=t2516;} -t2496=t2506;} -t2475=t2496;} -t2469=t2475;} -t2463=t2469;} -t2457=t2463;} -t2452=t2457;} -t2450=t2452;}};return t720(t2448,t728);};t731=t2447;var t2552=function(k1284){var t2553=function(t1285){var t781=t1285;var t786=SPOCK.EOF;var t2554=(t781)===(t786);var t783=t2554;var t2555;if(t783!==false){t2555=t783;} -else{var t2558=new SPOCK.Char("\n");var t2557=SPOCK.check(t2558,SPOCK.Char);var t2556=t2557.character;var t789=t2556;var t2560=SPOCK.check(t781,SPOCK.Char);var t2559=t2560.character;var t790=t2559;var t2561=(t789)===(t790);t2555=t2561;} -var t782=t2555;var t2562;if(t782!==false){t2562=false;} -else{t2562=true;} -var t1035=t2562;var t2563;if(t1035!==false){return t732(k1284);} -else{return k1284(undefined);}};return t720(t2553,t728);};t732=t2552;var t2567=function(k1286){var t2568=function(t1287){var t791=t1287;var t2570=SPOCK.check(t791,SPOCK.Char);var t2569=(t2570).character.match(/^\s$/);var t794=t2569;var t2572=null;var t2571=(t794)===(t2572);var t793=t2571;var t2573;if(t793!==false){t2573=false;} -else{t2573=true;} -var t1036=t2573;var t2574;if(t1036!==false){var t2575=function(t1288){return t733(k1286);};return t720(t2575,t728);} -else{return k1286(t791);}};return t722(t2568,t728);};t733=t2567;var t2580=function(k1289){var t2581=function(t1290){var t797=t1290;var t800=SPOCK.EOF;var t2582=(t797)===(t800);var t1037=t2582;var t2583;if(t1037!==false){return ____25error(k1289,"unexpected EOF after `#'");} -else{var t801=t797;var t2587=new SPOCK.Char("t");var t2586=SPOCK.eqvp(t797,t2587);var t1038=t2586;var t2588;if(t1038!==false){t2588=true;} -else{var t2590=new SPOCK.Char("T");var t2589=SPOCK.eqvp(t797,t2590);var t1039=t2589;var t2591;if(t1039!==false){t2591=true;} -else{t2591=false;} -t2588=t2591;} -var t2585;if(t2588!==false){return k1289(true);} -else{var t2595=new SPOCK.Char("f");var t2594=SPOCK.eqvp(t797,t2595);var t1040=t2594;var t2596;if(t1040!==false){t2596=true;} -else{var t2598=new SPOCK.Char("F");var t2597=SPOCK.eqvp(t797,t2598);var t1041=t2597;var t2599;if(t1041!==false){t2599=true;} -else{t2599=false;} -t2596=t2599;} -var t2593;if(t2596!==false){return k1289(false);} -else{var t2603=new SPOCK.Char("(");var t2602=SPOCK.eqvp(t797,t2603);var t1042=t2602;var t2604;if(t1042!==false){t2604=true;} -else{t2604=false;} -var t2601;if(t2604!==false){var t2605=function(t1291){return t723(k1289,t1291);};var t2607=new SPOCK.Char(")");return t735(t2605,t2607);} -else{var t2611=new SPOCK.Char("%");var t2610=SPOCK.eqvp(t801,t2611);var t1043=t2610;var t2612;if(t1043!==false){t2612=true;} -else{var t2614=new SPOCK.Char("!");var t2613=SPOCK.eqvp(t801,t2614);var t1044=t2613;var t2615;if(t1044!==false){t2615=true;} -else{t2615=false;} -t2612=t2615;} -var t2609;if(t2612!==false){var t2616=function(t1294){var t816=t1294;var t1293=t816;var t2617=function(t1292){return ___string_2d_3esymbol(k1289,t1292);};return t737(t2617,t1293);};var t2620=new SPOCK.Char("#");return ____25list(t2616,t797,t2620);} -else{var t2624=new SPOCK.Char("\\");var t2623=SPOCK.eqvp(t801,t2624);var t1045=t2623;var t2625;if(t1045!==false){t2625=true;} -else{t2625=false;} -var t2622;if(t2625!==false){var t2626=function(t1295){var t819=t1295;var t2628=SPOCK.jstring("newline");var t2627=t2628.toLowerCase();var t822=t2627;var t2630=SPOCK.jstring(t819);var t2629=t2630.toLowerCase();var t823=t2629;var t2631=(t822)===(t823);var t1046=t2631;var t2632;if(t1046!==false){var t2633=new SPOCK.Char("\n");return k1289(t2633);} -else{var t2636=SPOCK.jstring("tab");var t2635=t2636.toLowerCase();var t828=t2635;var t2638=SPOCK.jstring(t819);var t2637=t2638.toLowerCase();var t829=t2637;var t2639=(t828)===(t829);var t1047=t2639;var t2640;if(t1047!==false){var t2641=new SPOCK.Char("\t");return k1289(t2641);} -else{var t2644=SPOCK.jstring("space");var t2643=t2644.toLowerCase();var t834=t2643;var t2646=SPOCK.jstring(t819);var t2645=t2646.toLowerCase();var t835=t2645;var t2647=(t834)===(t835);var t1048=t2647;var t2648;if(t1048!==false){var t2649=new SPOCK.Char(" ");return k1289(t2649);} -else{var t2652=SPOCK.jstring(t819);var t2651=t2652.length;var t838=t2651;var t2653=SPOCK.check(t838,'number');var t842=t2653;var t2654=(0)===(t842);var t1049=t2654;var t2655;if(t1049!==false){return ____25error(k1289,"invalid character syntax");} -else{return ___string_2dref(k1289,t819,0);} -t2648=t2655;} -t2640=t2648;} -t2632=t2640;}};var t2658=null;return t737(t2626,t2658);} -else{return ____25error(k1289,"invalid `#' syntax",t797);} -t2609=t2622;} -t2601=t2609;} -t2593=t2601;} -t2585=t2593;} -t2583=t2585;}};return t720(t2581,t728);};t734=t2580;var t2662=function(k1296,t843){var r=SPOCK.count(arguments,"t735");if(r)return r;var t844=undefined;var t2663=function(k1297,t845){var r=SPOCK.count(arguments,"t844");if(r)return r;var t2664=function(t1298){var t846=t1298;var t849=SPOCK.EOF;var t2665=(t846)===(t849);var t1050=t2665;var t2666;if(t1050!==false){return ____25error(k1297,"unexpected EOF while reading list");} -else{var t851=t843;var t2669=SPOCK.check(t846,SPOCK.Char);var t2668=t2669.character;var t852=t2668;var t2671=SPOCK.check(t851,SPOCK.Char);var t2670=t2671.character;var t853=t2670;var t2672=(t852)===(t853);var t1051=t2672;var t2673;if(t1051!==false){var t2674=function(t1299){return t721(k1297,t845);};return t720(t2674,t728);} -else{var t2678=new SPOCK.Char(".");var t2677=SPOCK.eqvp(t2678,t846);var t1052=t2677;var t2679;if(t1052!==false){var t2680=function(t1300){var t856=t1300;var t2681=SPOCK.jstring(".");var t859=t2681;var t2682=SPOCK.jstring(t856);var t860=t2682;var t2683=(t859)===(t860);var t1053=t2683;var t2684;if(t1053!==false){var t2685=function(t1301){var t863=t1301;var t2686=function(t1302){var t2687=function(t1303){var t864=t1303;var t865=t843;var t2688=SPOCK.eqvp(t864,t865);var t1054=t2688;var t2689;if(t1054!==false){var t2690=function(t1304){return ___append(k1297,t1304,t863);};return t721(t2690,t845);} -else{return ____25error(k1297,"missing closing delimiter",t843);}};return t720(t2687,t728);};return t733(t2686);};return t731(t2685);} -else{var t2697=function(t1306){var t866=t1306;var t2698=new SPOCK.Pair(t866,undefined);var t1305=t2698;return t844(k1297,t1305,t845);};return t730(t2697,t856);}};var t2701=null;return t737(t2680,t2701);} -else{var t2703=function(t1308){var t868=t1308;var t2704=new SPOCK.Pair(t868,t845);var t1307=t2704;return t844(k1297,t1307);};return t731(t2703);} -t2673=t2679;} -t2666=t2673;}};return t733(t2664);};t844=t2663;var t2708=null;return t844(k1296,t2708);};t735=t2662;var t2710=function(k1309){var t870=undefined;var t2711=function(k1310,t871){var r=SPOCK.count(arguments,"t870");if(r)return r;var t2712=function(t1311){var t872=t1311;var t875=SPOCK.EOF;var t2713=(t872)===(t875);var t1055=t2713;var t2714;if(t1055!==false){return ____25error(k1310,"unexpected EOF while reading string");} -else{var t2718=new SPOCK.Char("\"");var t2717=SPOCK.check(t2718,SPOCK.Char);var t2716=t2717.character;var t878=t2716;var t2720=SPOCK.check(t872,SPOCK.Char);var t2719=t2720.character;var t879=t2719;var t2721=(t878)===(t879);var t1056=t2721;var t2722;if(t1056!==false){var t2723=function(t1312){return t724(k1310,t1312);};return t721(t2723,t871);} -else{var t2728=new SPOCK.Char("\\");var t2727=SPOCK.check(t2728,SPOCK.Char);var t2726=t2727.character;var t882=t2726;var t2730=SPOCK.check(t872,SPOCK.Char);var t2729=t2730.character;var t883=t2729;var t2731=(t882)===(t883);var t1057=t2731;var t2732;if(t1057!==false){var t2733=function(t1313){var t884=t1313;var t887=SPOCK.EOF;var t2734=(t884)===(t887);var t1058=t2734;var t2735;if(t1058!==false){return ____25error(k1310,"unexpected EOF while reading string");} -else{var t2739=new SPOCK.Char("n");var t2738=SPOCK.eqvp(t884,t2739);var t1059=t2738;var t2740;if(t1059!==false){t2740=true;} -else{t2740=false;} -var t2737;if(t2740!==false){var t2742=new SPOCK.Char("\n");var t2741=new SPOCK.Pair(t2742,t871);return t870(k1310,t2741);} -else{var t2746=new SPOCK.Char("t");var t2745=SPOCK.eqvp(t884,t2746);var t1060=t2745;var t2747;if(t1060!==false){t2747=true;} -else{t2747=false;} -var t2744;if(t2747!==false){var t2749=new SPOCK.Char("\t");var t2748=new SPOCK.Pair(t2749,t871);return t870(k1310,t2748);} -else{var t2751=new SPOCK.Pair(t884,t871);return t870(k1310,t2751);} -t2737=t2744;} -t2735=t2737;}};return t720(t2733,t728);} -else{var t2754=new SPOCK.Pair(t872,t871);return t870(k1310,t2754);} -t2722=t2732;} -t2714=t2722;}};return t720(t2712,t728);};t870=t2711;var t2757=null;return t870(k1309,t2757);};t736=t2710;var t2759=function(k1314,t901){var r=SPOCK.count(arguments,"t737");if(r)return r;var t902=undefined;var t2760=function(k1315,t903){var r=SPOCK.count(arguments,"t902");if(r)return r;var t2761=function(t1316){var t904=t1316;var t908=SPOCK.EOF;var t2762=(t904)===(t908);var t905=t2762;var t2763=function(t1317){var t1061=t1317;var t2764;if(t1061!==false){var t2765=function(t1318){return t724(k1315,t1318);};return t721(t2765,t903);} -else{var t2768=function(t1320){var t915=t1320;var t2769=new SPOCK.Pair(t915,t903);var t1319=t2769;return t902(k1315,t1319);};return t720(t2768,t728);}};var t1321=t2763;var t2772;if(t905!==false){return t1321(t905);} -else{var t2774=function(t1322){var t909=t1322;var t2775;if(t909!==false){t2775=t909;} -else{var t2777=SPOCK.check(t904,SPOCK.Char);var t2776=(t2777).character.match(/^\s$/);var t912=t2776;var t2779=null;var t2778=(t912)===(t2779);var t911=t2778;var t2780;if(t911!==false){t2780=false;} -else{t2780=true;} -t2775=t2780;} -return t1321(t2775);};var t2782=new SPOCK.Pair(new SPOCK.Char("{"),new SPOCK.Pair(new SPOCK.Char("}"),new SPOCK.Pair(new SPOCK.Char("("),new SPOCK.Pair(new SPOCK.Char(")"),new SPOCK.Pair(new SPOCK.Char("["),new SPOCK.Pair(new SPOCK.Char("]"),new SPOCK.Pair(new SPOCK.Char(";"),new SPOCK.Pair(new SPOCK.Char("\""),null))))))));return ___memv(t2774,t904,t2782);}};return t722(t2761,t728);};t902=t2760;return t902(k1314,t901);};t737=t2759;return t731(k1265);};var t1323=t2440;var t2787;if(t1019!==false){return t725(t1323);} -else{return t1323(t727);}};___read=t2438;var t2790=function(k1324,t917,t918){var r=SPOCK.count(arguments,"load");if(r)return r;loop:while(true){var t2792=SPOCK.jstring(t917);var t2793=t918===undefined;var t920=t2793;var t2794;if(t920!==false){t2794=false;} -else{t2794=true;} -var t1062=t2794;var t2795;if(t1062!==false){var t2796=SPOCK.callback(t918);t2795=t2796;} -else{t2795=false;} -var t2791=SPOCK.load(t2792,t2795);return k1324(t2791);}};___load=t2790;var t2798=function(K){SPOCK.count(arguments,'%error');SPOCK.error.apply(SPOCK.global,Array.prototype.slice.call(arguments,1));};____25error=t2798;___error=____25error;var t2799=function(k1325,t922){var r=SPOCK.count(arguments,"exit");if(r)return r;loop:while(true){var t2801=t922===undefined;var t1063=t2801;var t2802;if(t1063!==false){t2802=0;} -else{var t2803=SPOCK.check(t922,'number',"exit");t2802=t2803;} -var t2800=SPOCK.exit(t2802);return k1325(t2800);}};___exit=t2799;var t2805=function(k1326,t924){var r=SPOCK.count(arguments,"milliseconds");if(r)return r;var t2806=(new Date()).getTime();var t925=t2806;var t2807=t924===undefined;var t1064=t2807;var t2808;if(t1064!==false){return k1326(t925);} -else{var t2810=function(t1327){var t2811=(new Date()).getTime();var t928=t2811;var t2812=(t928)-(t925);return k1326(t2812);};return t924(t2810);}};___milliseconds=t2805;var t2815=function(k1328,t929){var t929=SPOCK.rest(arguments,1,'print');var t2816=function(t1329){return ___newline(k1328);};return ___for_2deach(t2816,___display,t929);};___print=t2815;var t2819=function(k1330,t930){var t930=SPOCK.rest(arguments,1,'o');var t2821=null;var t2820=(t930)===(t2821);var t1065=t2820;var t2822;if(t1065!==false){var t2823=function(k1331,t934){var r=SPOCK.count(arguments);if(r)return r;loop:while(true){return k1331(t934);}};return k1330(t2823);} -else{var t935=undefined;var t2826=function(k1332,t936){var r=SPOCK.count(arguments,"t935");if(r)return r;var t2827=t936.car;var t937=t2827;var t2828=t936.cdr;var t938=t2828;var t2830=null;var t2829=(t938)===(t2830);var t1066=t2829;var t2831;if(t1066!==false){t2831=t937;} -else{var t2832=function(k1333,t944){var r=SPOCK.count(arguments);if(r)return r;var t2833=function(t1335){var t2834=function(t1334){return t937(k1333,t1334);};return t1335(t2834,t944);};return t935(t2833,t938);};t2831=t2832;} -return k1332(t2831);};t935=t2826;return t935(k1330,t930);}};___o=t2819;var t2840=function(K){SPOCK.count(arguments,'%');var o={};for(var i=1;i<arguments.length;i+=2){var x=arguments[i];if(typeof x==='string')o[x]=arguments[i+1];else if(x instanceof SPOCK.String) -o[x.name]=arguments[i+1];else SPOCK.error('(%) object key not a string or symbol',x);} -return K(o);};____25=t2840;var t2841=function(K){SPOCK.count(arguments,'native');var func=arguments[1];return K(function(k){var args=Array.prototype.splice.call(arguments,1);return k(func.apply(SPOCK.global,args));});};___native=t2841;var t2842=function(K){SPOCK.count(arguments,'native-method');var func=arguments[1];return K(function(k){var args=Array.prototype.splice.call(arguments,2);return k(func.apply(arguments[1],args));});};___native_2dmethod=t2842;var t2843=function(K){SPOCK.count(arguments,'bind-method');var func=arguments[1];var that=arguments[2];return K(function(){return func.apply(that,arguments);});};___bind_2dmethod=t2843;var t2844=function(K){SPOCK.count(arguments,'jstring');var x=arguments[1];if(typeof x==='string')return K(x);else if(x instanceof SPOCK.String)return K(x.normalize());else if(x instanceof SPOCK.Char)return K(x.character);else return K(x);};___jstring=t2844;return k1067(undefined);};SPOCK.run(t1336);SPOCK.flush(); -\ No newline at end of file diff --git a/spock-runtime-debug.js b/spock-runtime-debug.js @@ -1,4963 +0,0 @@ -/* config.js - runtime-configuration for SPOCK */ - - -var SPOCK = { - STACKSIZE: 100, - THREADSLICE: 10, - TRACELENGTH: 32 -}; -/* runtime.js - SPOCK runtime (javascript part) */ - - -SPOCK.modules = {}; -SPOCK.symbolTable = {}; -SPOCK.stack = 0; -SPOCK.limit = SPOCK.STACKSIZE; -SPOCK.debug = false; -SPOCK.running = false; -SPOCK.runHook = []; -SPOCK.inBrowser = "document" in this; -SPOCK.global = this; - -SPOCK.Continuation = function(func, args) { - this.k_callee = func; - this.k_arguments = args; -}; - -SPOCK.Result = function(val) { - this.value = val; -}; - -SPOCK.Symbol = function(name) { - this.name = name; - this.plist = {}; -}; - -SPOCK.Pair = function(car, cdr) { - this.car = car; - this.cdr = cdr; -}; - -SPOCK.String = function(chars) { - if(typeof chars === "string") { - this.parts = [chars]; - this.length = chars.length; - } - else if(typeof chars === "number") this.parts = [chars.toString()]; - else this.parts = chars; // assumes chars is array -}; - -SPOCK.Char = function(str) { - this.character = str.charAt(0); -}; - -SPOCK.Port = function(direction, methods) { - var port = this; - var read = methods.read || function() { - SPOCK.error("reading from non-input port", port); - }; - - function doread(n) { - if(n === 0) return ""; - else if(this.peeked) { - var p = this.peeked; - this.peeked = false; - - if(n === 1) return p; - else return p + read(n - 1); - } - else return read(n); - } - - this.peeked = false; - this.direction = direction; - this.read = doread; - this.write = methods.write || function() { - SPOCK.error("writing to non-output port", port) - }; - this.close = methods.close || function() {}; - this.flush = methods.flush || function() {}; - this.ready = methods.ready || function() { return true; }; - this.closed = false; -}; - -SPOCK.Promise = function(thunk) { - this.thunk = thunk; -}; - -SPOCK.EndOfFile = function() {}; -SPOCK.EOF = new SPOCK.EndOfFile(); - -SPOCK.check = function(val, type, loc) { - if(typeof type === "function" && val instanceof type) return val; - if(typeof val === type) return val; - else SPOCK.error((loc ? "(" + loc + ") " : "") + - "bad argument type" + - (typeof type === "string" ? " - expected `" + type + "'" : ""), - val); -}; - -SPOCK.intern = function(str) { - var old = SPOCK.symbolTable[ str ]; - - if(old) return old; - else return SPOCK.symbolTable[ str ] = new SPOCK.Symbol(str); -}; - -SPOCK.stringify = function(x, readable) { - if(readable === undefined) readable = true; - - if(typeof x === "function") return "#<procedure>"; - else if(x === undefined) return "#<undefined>"; - else if(x === null) return "()"; - else if(x instanceof SPOCK.Continuation) return "#<continuation>"; - else if(x instanceof SPOCK.Symbol) return x.name; - else if(x instanceof SPOCK.Pair) { - var str = "("; - var f = false; - - for(var p = x; p !== null && p instanceof SPOCK.Pair; p = p.cdr) { - if(f) str += " "; - - str += SPOCK.stringify(p.car, readable); - f = true; - } - - if(p !== null) str += " . " + SPOCK.stringify(p, readable); - - return str + ")"; - } - else if(x instanceof Array) { - var str = "#("; - var f = false; - - for(var i in x) { - if(f) str += " "; - - str += SPOCK.stringify(x[ i ], readable); - f = true; - } - - return str + ")"; - } - else if(x instanceof SPOCK.String) { - if(readable) - return "\"" + x.normalize() + "\""; // XXX does not escape embedded characters - else return x.normalize(); - } - else if(x instanceof SPOCK.Char) { - if(readable) return x.character; - - switch(x.character) { - case "\n": return "#\\newline"; - case "\t": return "#\\tab"; - case "\r": return "#\\return"; - case " ": return "#\\space"; - default: return "#\\" + x.character; - } - } - else if(x instanceof SPOCK.Port) - return "#<" + x.direction + " port" + - (x.name ? (" \"" + x.name + "\">") : ">"); - else if(x instanceof SPOCK.Promise) return "#<promise>"; - else if(x instanceof SPOCK.EndOfFile) return "#<eof>"; - else return x.toString(); -}; - -SPOCK.error = function(msg) { - var args = Array.prototype.splice.call(arguments, 1); - - function argstr(x) { - return SPOCK.stringify(x, true); - } - - if(args.length > 0) - msg = msg + ":\n " + SPOCK.map(argstr, args).join("\n "); - - throw new Error(msg); -}; - -if(this.quit) SPOCK.exit = quit; -else SPOCK.exit = function(code) { - SPOCK.error("no suitable primitive available for `exit'"); - }; - -SPOCK.String.prototype.normalize = function() { - if(this.parts.length === 0) return ""; - - this.parts = [this.parts.join("")]; - return this.parts[ 0 ]; -}; - -SPOCK.jstring = function(x) { - if(typeof x === "string") return x; - else if(x instanceof SPOCK.String) return x.normalize(); - else return x; -}; - -SPOCK.list = function() { - var lst = null; - var len = arguments.length; - - for(var i = len - 1; i >= 0; --i) - lst = new SPOCK.Pair(arguments[ i ], lst); - - return lst; -}; - -SPOCK.length = function(lst) { - for(var n = 0; lst instanceof SPOCK.Pair; ++n) - lst = lst.cdr; - - return n; -}; - -SPOCK.map = function(func, array) { - var len = array.length; - var a2 = new Array(len); - - for(var i in array) - a2[ i ] = func(array[ i ]); - - return a2; -}; - -SPOCK.eqvp = function(x, y) { - if(x === y) return true; - else if(x instanceof SPOCK.Char) - return y instanceof SPOCK.Char && x.character === y.character; - else return false; -}; - -SPOCK.equalp = function(x, y) { - if(x === y) return true; - else if(x instanceof SPOCK.Pair) - return y instanceof SPOCK.Pair && - SPOCK.equalp(x.car, y.car) && - SPOCK.equalp(x.cdr, y.cdr); - else if(x instanceof Array) { - var len = x.length; - if(!(y instanceof Array) || y.length != len) return false; - for(var i = 0; i < len; ++i) { - if(!SPOCK.equalp(x[ i ], y[ i ])) return false; - } - return true; - } - else if(x instanceof SPOCK.Char) - return y instanceof SPOCK.Char && x.characters === y.characters; - else if(x instanceof SPOCK.String) { - var s1 = x.normalize(); - - if(y instanceof SPOCK.String) return s1 === y.normalize(); - else if(typeof y === 'string') return s1 === y; - else return false; - } - else if(typeof x === 'string') { - if(y instanceof SPOCK.String) return x === y.normalize(); - else if(typeof y === 'string') return x === y; - else return false; - } - else return false; -}; - -SPOCK.count = function(args, loc) { - if(--SPOCK.stack <= 0) - return new SPOCK.Continuation(args.callee, Array.prototype.slice.call(args)); - else return false; -}; - -SPOCK.rest = function(args, count, loc) { - var rest = null; - - // this will not unwind, but decrease the counter - SPOCK.count(args, loc); - - for(var i = args.length - 1; i >= count; --i) - rest = new SPOCK.Pair(args[ i ], rest); - - return rest; -}; - -SPOCK.statistics = function() {}; - -SPOCK.run = function(func) { // optional arguments - function terminate(result) { - return new SPOCK.Result(result); - } - - var k = terminate; - var args = [k].concat(Array.prototype.slice.call(arguments, 1)); - var oldstack = SPOCK.stack; - var oldlimit = SPOCK.limit; - var oldrunning = SPOCK.running; - SPOCK.limit = Math.max(10, oldlimit - oldstack); - SPOCK.stack = SPOCK.limit; - SPOCK.running = true; - - function restore() { - SPOCK.stack = oldstack; - SPOCK.limit = oldlimit; - SPOCK.running = oldrunning; - - if(!oldrunning) { - for(var i in SPOCK.runHook) - (SPOCK.runHook[ i ])(false); - } - } - - var result; - - if(!oldrunning) { - for(var i in SPOCK.runHook) - (SPOCK.runHook[ i ])(true); - } - - while(true) { - result = func.apply(SPOCK.global, args); - - if(result instanceof SPOCK.Continuation) { - SPOCK.stack = SPOCK.STACKSIZE; - func = result.k_callee; - args = result.k_arguments; - } - else if(result instanceof SPOCK.Result) { - restore(); - return result.value; - } - else { - restore(); - SPOCK.error("unexpected return of non-continuation", result); - } - } - - return result; -}; - -SPOCK.callback = function(proc) { - return function() { - var args = Array.prototype.slice.call(arguments); - args.unshift(proc); - return SPOCK.run.apply(this, args); - }; -}; - -SPOCK.callbackMethod = function(proc) { - var g = this; - return function() { - var args = Array.prototype.slice.call(arguments); - args.unshift(this); - args.unshift(proc); - return SPOCK.run.apply(g, args); - }; -}; - -SPOCK.go = function(proc) { - (SPOCK.callback(proc))(); -}; - -if("java" in this) { // rhino - SPOCK.makeJavaInputPort = function(jp) { - return new SPOCK.Port("input", { - read: function(n) { - var buffer = ""; - - while(n--) { - var b = jp.read(); - - if(b === -1) break; - else buffer += String.fromCharCode(b); - } - - return buffer === "" ? SPOCK.EOF : buffer; - }, - - close: function() { jp.close(); } - }); - }; - - SPOCK.makeJavaOutputPort = function(jp) { - return new SPOCK.Port("output", { - write: function(s) { - var len = s.length; - - for(var i = 0; i < len; ++i) - jp.write(s.charCodeAt(i)); - }, - - flush: function() { jp.flush(); }, - close: function() { jp.close(); } - }); - }; - - SPOCK.log = function() { - java.lang.System.err.println(Array.prototype.slice.call(arguments).join("")); - }; - - SPOCK.stdin = SPOCK.makeJavaInputPort(java.lang.System[ "in" ]); - SPOCK.stdout = SPOCK.makeJavaOutputPort(java.lang.System.out); - SPOCK.stderr = SPOCK.makeJavaOutputPort(java.lang.System.err); - SPOCK.stderr.name = "[stderr]"; -} -else { - if("console" in this) SPOCK.log = console.log; // firebug - else if(SPOCK.inBrowser) // inside browser - SPOCK.log = function() { - var msg = arguments.join(" "); - - if(msg.charAt(msg.length - 1) == "\n") - msg = msg.substring(0, msg.length - 1); - - this.defaultStatus = msg; - }; - else if("print" in this) SPOCK.log = print; // spidermonkey/v8 - else if(typeof process !== undefined) SPOCK.log = console.log; // Node.JS - else SPOCK.error("no suitable output primitive available"); - - (function() { - var buffer = []; - - function flush() { - if(buffer.length > 0) { - SPOCK.log(buffer.join("")); - buffer = []; - } - } - - function write(s) { - var parts = SPOCK.stringify(s, false).split("\n"); - var len = parts.length - 1; - - if(len > 0) { // contains newline? - buffer.push(parts[ 0 ]); - flush(); - - if(len > 1) { - for(var i = 1; i < len; ++i) - SPOCK.log(parts[ i ]); - } - - buffer.push(parts[ len ]); - } - else buffer.push(parts[ 0 ]); - } - - SPOCK.stdout = new SPOCK.Port("output", { write: write, flush: flush }); - var inp; - var ibuffer = ""; - - if(this.prompt) { - inp = function(n) { - while(true) { - if(ibuffer.length <= n) { - var part = ibuffer.slice(0, n); - ibuffer = ibuffer.slice(n); - return part; - } - - var input = prompt("Expecting input for " + this.toString()); - - if(input === null) return SPOCK.EOF; - else ibuffer += input; - } - }; - } - else { - inp = function(n) { - SPOCK.error("no input possible for standard input port"); - }; - } - - SPOCK.stdin = new SPOCK.Port("input", { read: inp }); - SPOCK.stderr = SPOCK.stdout; - })(); -} - -SPOCK.stdin.name = "[stdin]"; -SPOCK.stdout.name = "[stdout]"; - -SPOCK.flush = function() { - // note that this always prints a newline when console.log or print is used - SPOCK.stdout.flush(); - - if(SPOCK.stderr !== SPOCK.stdout) - SPOCK.stderr.flush(); - - SPOCK.statistics(); -}; - -if(this.gc) SPOCK.gc = gc; -else SPOCK.gc = function() {}; - -SPOCK.openInputUrlHook = function(url) { - SPOCK.error("can not open", url); -}; - -SPOCK.openOutputUrlHook = function(url) { - SPOCK.error("can not open", url); -}; - -if("java" in this) { - SPOCK.openInputFile = function(filename) { - var stream; - - try { - stream = new java.io.FileInputStream(filename); - } - catch(e) { - SPOCK.error(e.message); - } - - var port = SPOCK.makeJavaInputPort(stream); - port.name = filename; - return port; - }; - - SPOCK.openOutputFile = function(filename) { - var stream; - - try { - stream = new java.io.FileOutputStream(filename); - } - catch(e) { - SPOCK.error(e.message); - } - - var port = SPOCK.makeJavaOutputPort(stream); - port.name = filename; - return port; - }; - - SPOCK.fileExists = function(filename) { - return (new java.io.File(filename)).exists(); - }; -} -else { - if(SPOCK.inBrowser) { - SPOCK.openInputFile = function(filename) { - if(filename.match(/^[a-z0-9]+:/)) - return SPOCK.openInputUrlHook(filename); - - var cookies = document.cookie.split("; "); - var buffer = null; - - for(var i = 0; i < cookies.length; ++i) { - var c = cookies[ i ]; - var p = c.indexOf("="); - - if(filename === c.substring(0, p)) { - buffer = c.substring(p + 1); - break; - } - } - - if(!buffer) SPOCK.error("can not open file", filename); - - var pos = 0; - - return new SPOCK.Port("input", { - read: function(n) { - if(pos >= buffer.length) return SPOCK.EOF; - else if(pos + len >= buffer.length) - return buffer.substring(pos); - - var p1 = pos; - pos += n; - return buffer.substring(p1, p1 + n); - }, - - ready: function() { return pos < buffer.length; } - }); - }; - - SPOCK.openOutputFile = function(filename, expiry) { - if(filename.match(/^[a-z0-9]+:/)) - return SPOCK.openOutputUrlHook(filename); - - return new SPOCK.Port("output", { - write: function(s) { buffer += s; }, - close: function() { - var now = (new Date()).getTime(); - var exp = now + (expiry || (1000 * 60 * 60 * 24 * 365)); - document.cookie = filename + "=" + encodeURIComponent(buffer) + - "; expires=" + (new Date(exp)).toGMTString(); - } - }); - }; - } - else { - SPOCK.openInputFile = function(filename) { - SPOCK.error("file-I/O not available"); - } - - SPOCK.openOutputFile = function(filename) { - SPOCK.error("file-I/O not available"); - } - } - - SPOCK.fileExists = function(filename) { - SPOCK.error("`file-exists?' not available"); - }; -} - -if("document" in this) { // browser? - SPOCK.load = function(url, k) { - // http://www.nczonline.net/blog/2009/07/28/the-best-way-to-load-external-javascript/ - var script = document.createElement("script") - - script.type = "text/javascript"; - k = k || function() {}; - - if (script.readyState){ //IE - script.onreadystatechange = function(){ - if (script.readyState == "loaded" || script.readyState == "complete"){ - script.onreadystatechange = null; - k(url); - } - }; - } - else { //Others - script.onload = function(){ - k(url); - }; - } - - script.src = url; - document.getElementsByTagName("head")[0].appendChild(script); - }; -} -else if("load" in this) { // rhino/SM - SPOCK.load = function(filename, k) { - load(filename); - - if(k) k(filename); - }; -} -/* debug.js - debugging-support for SPOCK runtime */ - - -SPOCK.debug = true; -SPOCK.toString = function() { return "#<SPOCK>"; }; -SPOCK.restartCount = 0; -SPOCK.traceBuffer = []; -SPOCK.traceOutput = false; -SPOCK.traceHook = []; -SPOCK.hasAlert = SPOCK.inBrowser; - -// Overrides SPOCK.error -SPOCK.error = function(msg) { // "msg" may be a string or an error object - var args = Array.prototype.splice.call(arguments, 1); - var err; - var text; - - if(typeof msg !== "string") { // an object? - err = msg; - msg = err.message; - } - - text = msg; - - if(args.length > 1) - text += ":\n " + SPOCK.map(SPOCK.stringify, args).join("\n "); - - if(SPOCK.traceBuffer.length > 0) - text += "\n\nCall trace:\n\n" + SPOCK.getTrace(); - - if(SPOCK.hasAlert) { - alert("Error: " + text); - SPOCK.hasAlert = false; // disable to avoid endless repetition of alerts - } - else if(err) throw new (err.constructor)(text); - else throw new Error(text); -}; - -// Overrides SPOCK.count -SPOCK.count = function(args, loc) { - if(--SPOCK.stack <= 0) { - ++SPOCK.restartCount; - return new SPOCK.Continuation(args.callee, Array.prototype.slice.call(args)); - } - - if(loc) SPOCK.trace(loc, args); - - return false; -}; - -SPOCK.trace = function(name, args) { - var tb = SPOCK.traceBuffer; - - for(var i in SPOCK.traceHook) - (SPOCK.traceHook[ i ])(name, args); - - if(SPOCK.traceOutput) - SPOCK.log("[" + SPOCK.stack + "] " + name); - - if(tb.length >= SPOCK.TRACELENGTH) tb.shift(); - - tb.push([name, Array.prototype.slice.call(args, 1)]); // skip continuation argument -}; - -SPOCK.getTrace = function() { - var tb = SPOCK.traceBuffer; - var trace = []; - - for(var i in tb) { - var e = tb[ i ]; - trace.push(" (" + e[ 0 ] + " " + - SPOCK.map(SPOCK.stringify, e[ 1 ]).join(" ") + ")"); - } - - SPOCK.traceBuffer = []; - return trace.join("\n") + " <---"; -}; - -// Overrides empty SPOCK.statistics -SPOCK.statistics = function() { - //if(SPOCK.restartCount > 0) - // SPOCK.log("restarts: ", SPOCK.restartCount); - - SPOCK.traceBuffer = []; -}; - -// Overrides SPOCK.callback -(function() { - var old = SPOCK.callback; - - SPOCK.callback = function(proc) { - var cb = old(proc); - return function() { - var args = Array.prototype.slice.call(arguments); - SPOCK.trace("<callback>", args); - return cb.apply(this, args); - }; - }; -})(); -/* CODE GENERATED BY SPOCK 0 */ -var t1336 = function (k1067) { - var t1337 = function (k1068, t1) { // %list - var t1 = SPOCK.rest(arguments, 1, '%list'); - loop: while(true) { - return k1068(t1); - } - }; - ____25list = t1337; // set! %list - var t1339 = function(K) { - SPOCK.count(arguments, 'values'); - return K.apply(SPOCK.global, Array.prototype.slice.call(arguments, 1)); - }; - ___values = t1339; // set! values - var t1340 = function(K) { - SPOCK.count(arguments, 'call-with-values'); - var thunk = arguments[ 1 ]; - var proc = arguments[ 2 ]; - function k2() { - var args = Array.prototype.slice.call(arguments); - args.unshift(K); - return proc.apply(SPOCK.global, args);} - return thunk(k2); - }; - ___call_2dwith_2dvalues = t1340; // set! call-with-values - var t1341 = function(K) { - SPOCK.count(arguments, '%call-with-saved-values'); - var t1 = arguments[ 1 ]; - var t2 = arguments[ 2 ]; - var args; - function k2() { return K.apply(SPOCK.global, args); } - function k1() { - args = Array.prototype.slice.call(arguments); - return t2(k2);} - return t1(k1); - }; - ____25call_2dwith_2dsaved_2dvalues = t1341; // set! %call-with-saved-values - var t1342 = function (k1069, t2) { // list? - var r = SPOCK.count(arguments, "list?"); - if(r) return r; - var t3 = undefined; - var t1343 = function (k1070, t4, t5) { // t3 - var r = SPOCK.count(arguments, "t3"); - if(r) return r; - loop: while(true) { - var t1345 = null; - var t1344 = (t4) === (t1345); - var t6 = t1344; - var t1346; - if(t6 !== false) { - return k1070(t6); - } - else { - var t1348 = (t4) instanceof SPOCK.Pair ; - var t945 = t1348; - var t1349; - if(t945 !== false) { - var t1350 = t4.cdr; - var t11 = t1350; - var t1352 = null; - var t1351 = (t11) === (t1352); - var t13 = t1351; - var t1353; - if(t13 !== false) { - return k1070(t13); - } - else { - var t1355 = (t11) instanceof SPOCK.Pair ; - var t946 = t1355; - var t1356; - if(t946 !== false) { - var t1357 = t11.cdr; - var t18 = t1357; - var t1358 = t5.cdr; - var t19 = t1358; - var t1359 = (t18) === (t19); - var t22 = t1359; - var t1360; - if(t22 !== false) { - t1360 = false; - } - else { - t1360 = true; - } - var t947 = t1360; - var t1361; - if(t947 !== false) { - var t1362 = t18; - var t1363 = t19; - t4 = t1362; - t5 = t1363; - continue loop; - } - else { - return k1070(false); - } - t1356 = t1361; - } - else { - return k1070(false); - } - t1353 = t1356; - } - t1349 = t1353; - } - else { - return k1070(false); - } - t1346 = t1349; - } - } - }; - t3 = t1343; // set! t3 - return t3(k1069, t2, t2); - }; - ___list_3f = t1342; // set! list? - var t1368 = function (k1071, t25) { // caaar - var r = SPOCK.count(arguments, "caaar"); - if(r) return r; - loop: while(true) { - var t1369 = SPOCK.check(t25, SPOCK.Pair, "caaar"); - var t29 = t1369; - var t1370 = t29.car; - var t27 = t1370; - var t1371 = SPOCK.check(t27, SPOCK.Pair, "caaar"); - var t30 = t1371; - var t1372 = t30.car; - var t26 = t1372; - var t1373 = SPOCK.check(t26, SPOCK.Pair, "caaar"); - var t31 = t1373; - var t1374 = t31.car; - return k1071(t1374); - } - }; - ___caaar = t1368; // set! caaar - var t1376 = function (k1072, t32) { // caadr - var r = SPOCK.count(arguments, "caadr"); - if(r) return r; - loop: while(true) { - var t1377 = SPOCK.check(t32, SPOCK.Pair, "caadr"); - var t36 = t1377; - var t1378 = t36.cdr; - var t34 = t1378; - var t1379 = SPOCK.check(t34, SPOCK.Pair, "caadr"); - var t37 = t1379; - var t1380 = t37.car; - var t33 = t1380; - var t1381 = SPOCK.check(t33, SPOCK.Pair, "caadr"); - var t38 = t1381; - var t1382 = t38.car; - return k1072(t1382); - } - }; - ___caadr = t1376; // set! caadr - var t1384 = function (k1073, t39) { // cadar - var r = SPOCK.count(arguments, "cadar"); - if(r) return r; - loop: while(true) { - var t1385 = SPOCK.check(t39, SPOCK.Pair, "cadar"); - var t43 = t1385; - var t1386 = t43.car; - var t41 = t1386; - var t1387 = SPOCK.check(t41, SPOCK.Pair, "cadar"); - var t44 = t1387; - var t1388 = t44.cdr; - var t40 = t1388; - var t1389 = SPOCK.check(t40, SPOCK.Pair, "cadar"); - var t45 = t1389; - var t1390 = t45.car; - return k1073(t1390); - } - }; - ___cadar = t1384; // set! cadar - var t1392 = function (k1074, t46) { // caddr - var r = SPOCK.count(arguments, "caddr"); - if(r) return r; - loop: while(true) { - var t1393 = SPOCK.check(t46, SPOCK.Pair, "caddr"); - var t50 = t1393; - var t1394 = t50.cdr; - var t48 = t1394; - var t1395 = SPOCK.check(t48, SPOCK.Pair, "caddr"); - var t51 = t1395; - var t1396 = t51.cdr; - var t47 = t1396; - var t1397 = SPOCK.check(t47, SPOCK.Pair, "caddr"); - var t52 = t1397; - var t1398 = t52.car; - return k1074(t1398); - } - }; - ___caddr = t1392; // set! caddr - var t1400 = function (k1075, t53) { // cdaar - var r = SPOCK.count(arguments, "cdaar"); - if(r) return r; - loop: while(true) { - var t1401 = SPOCK.check(t53, SPOCK.Pair, "cdaar"); - var t57 = t1401; - var t1402 = t57.car; - var t55 = t1402; - var t1403 = SPOCK.check(t55, SPOCK.Pair, "cdaar"); - var t58 = t1403; - var t1404 = t58.car; - var t54 = t1404; - var t1405 = SPOCK.check(t54, SPOCK.Pair, "cdaar"); - var t59 = t1405; - var t1406 = t59.cdr; - return k1075(t1406); - } - }; - ___cdaar = t1400; // set! cdaar - var t1408 = function (k1076, t60) { // cdadr - var r = SPOCK.count(arguments, "cdadr"); - if(r) return r; - loop: while(true) { - var t1409 = SPOCK.check(t60, SPOCK.Pair, "cdadr"); - var t64 = t1409; - var t1410 = t64.cdr; - var t62 = t1410; - var t1411 = SPOCK.check(t62, SPOCK.Pair, "cdadr"); - var t65 = t1411; - var t1412 = t65.car; - var t61 = t1412; - var t1413 = SPOCK.check(t61, SPOCK.Pair, "cdadr"); - var t66 = t1413; - var t1414 = t66.cdr; - return k1076(t1414); - } - }; - ___cdadr = t1408; // set! cdadr - var t1416 = function (k1077, t67) { // cddar - var r = SPOCK.count(arguments, "cddar"); - if(r) return r; - loop: while(true) { - var t1417 = SPOCK.check(t67, SPOCK.Pair, "cddar"); - var t71 = t1417; - var t1418 = t71.car; - var t69 = t1418; - var t1419 = SPOCK.check(t69, SPOCK.Pair, "cddar"); - var t72 = t1419; - var t1420 = t72.cdr; - var t68 = t1420; - var t1421 = SPOCK.check(t68, SPOCK.Pair, "cddar"); - var t73 = t1421; - var t1422 = t73.cdr; - return k1077(t1422); - } - }; - ___cddar = t1416; // set! cddar - var t1424 = function (k1078, t74) { // cdddr - var r = SPOCK.count(arguments, "cdddr"); - if(r) return r; - loop: while(true) { - var t1425 = SPOCK.check(t74, SPOCK.Pair, "cdddr"); - var t78 = t1425; - var t1426 = t78.cdr; - var t76 = t1426; - var t1427 = SPOCK.check(t76, SPOCK.Pair, "cdddr"); - var t79 = t1427; - var t1428 = t79.cdr; - var t75 = t1428; - var t1429 = SPOCK.check(t75, SPOCK.Pair, "cdddr"); - var t80 = t1429; - var t1430 = t80.cdr; - return k1078(t1430); - } - }; - ___cdddr = t1424; // set! cdddr - var t1432 = function (k1079, t81) { // caaaar - var r = SPOCK.count(arguments, "caaaar"); - if(r) return r; - loop: while(true) { - var t1433 = SPOCK.check(t81, SPOCK.Pair, "caaaar"); - var t86 = t1433; - var t1434 = t86.car; - var t84 = t1434; - var t1435 = SPOCK.check(t84, SPOCK.Pair, "caaaar"); - var t87 = t1435; - var t1436 = t87.car; - var t83 = t1436; - var t1437 = SPOCK.check(t83, SPOCK.Pair, "caaaar"); - var t88 = t1437; - var t1438 = t88.car; - var t82 = t1438; - var t1439 = SPOCK.check(t82, SPOCK.Pair, "caaaar"); - var t89 = t1439; - var t1440 = t89.car; - return k1079(t1440); - } - }; - ___caaaar = t1432; // set! caaaar - var t1442 = function (k1080, t90) { // caaadr - var r = SPOCK.count(arguments, "caaadr"); - if(r) return r; - loop: while(true) { - var t1443 = SPOCK.check(t90, SPOCK.Pair, "caaadr"); - var t95 = t1443; - var t1444 = t95.cdr; - var t93 = t1444; - var t1445 = SPOCK.check(t93, SPOCK.Pair, "caaadr"); - var t96 = t1445; - var t1446 = t96.car; - var t92 = t1446; - var t1447 = SPOCK.check(t92, SPOCK.Pair, "caaadr"); - var t97 = t1447; - var t1448 = t97.car; - var t91 = t1448; - var t1449 = SPOCK.check(t91, SPOCK.Pair, "caaadr"); - var t98 = t1449; - var t1450 = t98.car; - return k1080(t1450); - } - }; - ___caaadr = t1442; // set! caaadr - var t1452 = function (k1081, t99) { // caadar - var r = SPOCK.count(arguments, "caadar"); - if(r) return r; - loop: while(true) { - var t1453 = SPOCK.check(t99, SPOCK.Pair, "caadar"); - var t104 = t1453; - var t1454 = t104.car; - var t102 = t1454; - var t1455 = SPOCK.check(t102, SPOCK.Pair, "caadar"); - var t105 = t1455; - var t1456 = t105.cdr; - var t101 = t1456; - var t1457 = SPOCK.check(t101, SPOCK.Pair, "caadar"); - var t106 = t1457; - var t1458 = t106.car; - var t100 = t1458; - var t1459 = SPOCK.check(t100, SPOCK.Pair, "caadar"); - var t107 = t1459; - var t1460 = t107.car; - return k1081(t1460); - } - }; - ___caadar = t1452; // set! caadar - var t1462 = function (k1082, t108) { // caaddr - var r = SPOCK.count(arguments, "caaddr"); - if(r) return r; - loop: while(true) { - var t1463 = SPOCK.check(t108, SPOCK.Pair, "caaddr"); - var t113 = t1463; - var t1464 = t113.cdr; - var t111 = t1464; - var t1465 = SPOCK.check(t111, SPOCK.Pair, "caaddr"); - var t114 = t1465; - var t1466 = t114.cdr; - var t110 = t1466; - var t1467 = SPOCK.check(t110, SPOCK.Pair, "caaddr"); - var t115 = t1467; - var t1468 = t115.car; - var t109 = t1468; - var t1469 = SPOCK.check(t109, SPOCK.Pair, "caaddr"); - var t116 = t1469; - var t1470 = t116.car; - return k1082(t1470); - } - }; - ___caaddr = t1462; // set! caaddr - var t1472 = function (k1083, t117) { // cadaar - var r = SPOCK.count(arguments, "cadaar"); - if(r) return r; - loop: while(true) { - var t1473 = SPOCK.check(t117, SPOCK.Pair, "cadaar"); - var t122 = t1473; - var t1474 = t122.car; - var t120 = t1474; - var t1475 = SPOCK.check(t120, SPOCK.Pair, "cadaar"); - var t123 = t1475; - var t1476 = t123.car; - var t119 = t1476; - var t1477 = SPOCK.check(t119, SPOCK.Pair, "cadaar"); - var t124 = t1477; - var t1478 = t124.cdr; - var t118 = t1478; - var t1479 = SPOCK.check(t118, SPOCK.Pair, "cadaar"); - var t125 = t1479; - var t1480 = t125.car; - return k1083(t1480); - } - }; - ___cadaar = t1472; // set! cadaar - var t1482 = function (k1084, t126) { // cadadr - var r = SPOCK.count(arguments, "cadadr"); - if(r) return r; - loop: while(true) { - var t1483 = SPOCK.check(t126, SPOCK.Pair, "cadadr"); - var t131 = t1483; - var t1484 = t131.cdr; - var t129 = t1484; - var t1485 = SPOCK.check(t129, SPOCK.Pair, "cadadr"); - var t132 = t1485; - var t1486 = t132.car; - var t128 = t1486; - var t1487 = SPOCK.check(t128, SPOCK.Pair, "cadadr"); - var t133 = t1487; - var t1488 = t133.cdr; - var t127 = t1488; - var t1489 = SPOCK.check(t127, SPOCK.Pair, "cadadr"); - var t134 = t1489; - var t1490 = t134.car; - return k1084(t1490); - } - }; - ___cadadr = t1482; // set! cadadr - var t1492 = function (k1085, t135) { // caddar - var r = SPOCK.count(arguments, "caddar"); - if(r) return r; - loop: while(true) { - var t1493 = SPOCK.check(t135, SPOCK.Pair, "caddar"); - var t140 = t1493; - var t1494 = t140.car; - var t138 = t1494; - var t1495 = SPOCK.check(t138, SPOCK.Pair, "caddar"); - var t141 = t1495; - var t1496 = t141.cdr; - var t137 = t1496; - var t1497 = SPOCK.check(t137, SPOCK.Pair, "caddar"); - var t142 = t1497; - var t1498 = t142.cdr; - var t136 = t1498; - var t1499 = SPOCK.check(t136, SPOCK.Pair, "caddar"); - var t143 = t1499; - var t1500 = t143.car; - return k1085(t1500); - } - }; - ___caddar = t1492; // set! caddar - var t1502 = function (k1086, t144) { // cadddr - var r = SPOCK.count(arguments, "cadddr"); - if(r) return r; - loop: while(true) { - var t1503 = SPOCK.check(t144, SPOCK.Pair, "cadddr"); - var t149 = t1503; - var t1504 = t149.cdr; - var t147 = t1504; - var t1505 = SPOCK.check(t147, SPOCK.Pair, "cadddr"); - var t150 = t1505; - var t1506 = t150.cdr; - var t146 = t1506; - var t1507 = SPOCK.check(t146, SPOCK.Pair, "cadddr"); - var t151 = t1507; - var t1508 = t151.cdr; - var t145 = t1508; - var t1509 = SPOCK.check(t145, SPOCK.Pair, "cadddr"); - var t152 = t1509; - var t1510 = t152.car; - return k1086(t1510); - } - }; - ___cadddr = t1502; // set! cadddr - var t1512 = function (k1087, t153) { // cdaaar - var r = SPOCK.count(arguments, "cdaaar"); - if(r) return r; - loop: while(true) { - var t1513 = SPOCK.check(t153, SPOCK.Pair, "cdaaar"); - var t158 = t1513; - var t1514 = t158.car; - var t156 = t1514; - var t1515 = SPOCK.check(t156, SPOCK.Pair, "cdaaar"); - var t159 = t1515; - var t1516 = t159.car; - var t155 = t1516; - var t1517 = SPOCK.check(t155, SPOCK.Pair, "cdaaar"); - var t160 = t1517; - var t1518 = t160.car; - var t154 = t1518; - var t1519 = SPOCK.check(t154, SPOCK.Pair, "cdaaar"); - var t161 = t1519; - var t1520 = t161.cdr; - return k1087(t1520); - } - }; - ___cdaaar = t1512; // set! cdaaar - var t1522 = function (k1088, t162) { // cdaadr - var r = SPOCK.count(arguments, "cdaadr"); - if(r) return r; - loop: while(true) { - var t1523 = SPOCK.check(t162, SPOCK.Pair, "cdaadr"); - var t167 = t1523; - var t1524 = t167.cdr; - var t165 = t1524; - var t1525 = SPOCK.check(t165, SPOCK.Pair, "cdaadr"); - var t168 = t1525; - var t1526 = t168.car; - var t164 = t1526; - var t1527 = SPOCK.check(t164, SPOCK.Pair, "cdaadr"); - var t169 = t1527; - var t1528 = t169.car; - var t163 = t1528; - var t1529 = SPOCK.check(t163, SPOCK.Pair, "cdaadr"); - var t170 = t1529; - var t1530 = t170.cdr; - return k1088(t1530); - } - }; - ___cdaadr = t1522; // set! cdaadr - var t1532 = function (k1089, t171) { // cdadar - var r = SPOCK.count(arguments, "cdadar"); - if(r) return r; - loop: while(true) { - var t1533 = SPOCK.check(t171, SPOCK.Pair, "cdadar"); - var t176 = t1533; - var t1534 = t176.car; - var t174 = t1534; - var t1535 = SPOCK.check(t174, SPOCK.Pair, "cdadar"); - var t177 = t1535; - var t1536 = t177.cdr; - var t173 = t1536; - var t1537 = SPOCK.check(t173, SPOCK.Pair, "cdadar"); - var t178 = t1537; - var t1538 = t178.car; - var t172 = t1538; - var t1539 = SPOCK.check(t172, SPOCK.Pair, "cdadar"); - var t179 = t1539; - var t1540 = t179.cdr; - return k1089(t1540); - } - }; - ___cdadar = t1532; // set! cdadar - var t1542 = function (k1090, t180) { // cdaddr - var r = SPOCK.count(arguments, "cdaddr"); - if(r) return r; - loop: while(true) { - var t1543 = SPOCK.check(t180, SPOCK.Pair, "cdaddr"); - var t185 = t1543; - var t1544 = t185.cdr; - var t183 = t1544; - var t1545 = SPOCK.check(t183, SPOCK.Pair, "cdaddr"); - var t186 = t1545; - var t1546 = t186.cdr; - var t182 = t1546; - var t1547 = SPOCK.check(t182, SPOCK.Pair, "cdaddr"); - var t187 = t1547; - var t1548 = t187.car; - var t181 = t1548; - var t1549 = SPOCK.check(t181, SPOCK.Pair, "cdaddr"); - var t188 = t1549; - var t1550 = t188.cdr; - return k1090(t1550); - } - }; - ___cdaddr = t1542; // set! cdaddr - var t1552 = function (k1091, t189) { // cddaar - var r = SPOCK.count(arguments, "cddaar"); - if(r) return r; - loop: while(true) { - var t1553 = SPOCK.check(t189, SPOCK.Pair, "cddaar"); - var t194 = t1553; - var t1554 = t194.car; - var t192 = t1554; - var t1555 = SPOCK.check(t192, SPOCK.Pair, "cddaar"); - var t195 = t1555; - var t1556 = t195.car; - var t191 = t1556; - var t1557 = SPOCK.check(t191, SPOCK.Pair, "cddaar"); - var t196 = t1557; - var t1558 = t196.cdr; - var t190 = t1558; - var t1559 = SPOCK.check(t190, SPOCK.Pair, "cddaar"); - var t197 = t1559; - var t1560 = t197.cdr; - return k1091(t1560); - } - }; - ___cddaar = t1552; // set! cddaar - var t1562 = function (k1092, t198) { // cddadr - var r = SPOCK.count(arguments, "cddadr"); - if(r) return r; - loop: while(true) { - var t1563 = SPOCK.check(t198, SPOCK.Pair, "cddadr"); - var t203 = t1563; - var t1564 = t203.cdr; - var t201 = t1564; - var t1565 = SPOCK.check(t201, SPOCK.Pair, "cddadr"); - var t204 = t1565; - var t1566 = t204.car; - var t200 = t1566; - var t1567 = SPOCK.check(t200, SPOCK.Pair, "cddadr"); - var t205 = t1567; - var t1568 = t205.cdr; - var t199 = t1568; - var t1569 = SPOCK.check(t199, SPOCK.Pair, "cddadr"); - var t206 = t1569; - var t1570 = t206.cdr; - return k1092(t1570); - } - }; - ___cddadr = t1562; // set! cddadr - var t1572 = function (k1093, t207) { // cdddar - var r = SPOCK.count(arguments, "cdddar"); - if(r) return r; - loop: while(true) { - var t1573 = SPOCK.check(t207, SPOCK.Pair, "cdddar"); - var t212 = t1573; - var t1574 = t212.car; - var t210 = t1574; - var t1575 = SPOCK.check(t210, SPOCK.Pair, "cdddar"); - var t213 = t1575; - var t1576 = t213.cdr; - var t209 = t1576; - var t1577 = SPOCK.check(t209, SPOCK.Pair, "cdddar"); - var t214 = t1577; - var t1578 = t214.cdr; - var t208 = t1578; - var t1579 = SPOCK.check(t208, SPOCK.Pair, "cdddar"); - var t215 = t1579; - var t1580 = t215.cdr; - return k1093(t1580); - } - }; - ___cdddar = t1572; // set! cdddar - var t1582 = function (k1094, t216) { // cddddr - var r = SPOCK.count(arguments, "cddddr"); - if(r) return r; - loop: while(true) { - var t1583 = SPOCK.check(t216, SPOCK.Pair, "cddddr"); - var t221 = t1583; - var t1584 = t221.cdr; - var t219 = t1584; - var t1585 = SPOCK.check(t219, SPOCK.Pair, "cddddr"); - var t222 = t1585; - var t1586 = t222.cdr; - var t218 = t1586; - var t1587 = SPOCK.check(t218, SPOCK.Pair, "cddddr"); - var t223 = t1587; - var t1588 = t223.cdr; - var t217 = t1588; - var t1589 = SPOCK.check(t217, SPOCK.Pair, "cddddr"); - var t224 = t1589; - var t1590 = t224.cdr; - return k1094(t1590); - } - }; - ___cddddr = t1582; // set! cddddr - var t1592 = function (k1095, t225) { // append - var t225 = SPOCK.rest(arguments, 1, 'append'); - var t1594 = null; - var t1593 = (t225) === (t1594); - var t948 = t1593; - var t1595; - if(t948 !== false) { - var t1596 = null; - return k1095(t1596); - } - else { - var t229 = undefined; - var t1598 = function (k1096, t230) { // t229 - var r = SPOCK.count(arguments, "t229"); - if(r) return r; - var t1599 = t230.cdr; - var t231 = t1599; - var t1601 = null; - var t1600 = (t231) === (t1601); - var t949 = t1600; - var t1602; - if(t949 !== false) { - var t1603 = t230.car; - return k1096(t1603); - } - else { - var t236 = undefined; - var t1605 = function (k1097, t237) { // t236 - var r = SPOCK.count(arguments, "t236"); - if(r) return r; - var t1606 = (t237) instanceof SPOCK.Pair ; - var t950 = t1606; - var t1607; - if(t950 !== false) { - var t1608 = t237.car; - var t239 = t1608; - var t1609 = function (t1098) { - var t240 = t1098; - var t1610 = new SPOCK.Pair(t239, t240); - return k1097(t1610); - }; - var t1612 = t237.cdr; - return t236(t1609, t1612); - } - else { - var t243 = t230; - var t1614 = t243.cdr; - return t229(k1097, t1614); - } - }; - t236 = t1605; // set! t236 - var t1616 = t230.car; - return t236(k1096, t1616); - } - }; - t229 = t1598; // set! t229 - return t229(k1095, t225); - } - }; - ___append = t1592; // set! append - var t1619 = function (k1099, t245) { // reverse - var r = SPOCK.count(arguments, "reverse"); - if(r) return r; - var t246 = undefined; - var t1620 = function (k1100, t247, t248) { // t246 - var r = SPOCK.count(arguments, "t246"); - if(r) return r; - loop: while(true) { - var t1621 = (t247) instanceof SPOCK.Pair ; - var t951 = t1621; - var t1622; - if(t951 !== false) { - var t1625 = t247.cdr; - var t1623 = t1625; - var t1626 = t247.car; - var t251 = t1626; - var t1627 = new SPOCK.Pair(t251, t248); - var t1624 = t1627; - t247 = t1623; - t248 = t1624; - continue loop; - } - else { - return k1100(t248); - } - } - }; - t246 = t1620; // set! t246 - var t1629 = null; - return t246(k1099, t245, t1629); - }; - ___reverse = t1619; // set! reverse - var t1631 = function (k1101, t254, t255) { // list-tail - var r = SPOCK.count(arguments, "list-tail"); - if(r) return r; - var t256 = undefined; - var t1632 = function (k1102, t257, t258) { // t256 - var r = SPOCK.count(arguments, "t256"); - if(r) return r; - loop: while(true) { - var t1634 = (t257) <= 0 ; - var t1633; - if(t1634 !== false) { - return k1102(t258); - } - else { - var t1638 = (t257) - 1 ; - var t1636 = t1638; - var t1639 = SPOCK.check(t258, SPOCK.Pair, "t256"); - var t259 = t1639; - var t1640 = t259.cdr; - var t1637 = t1640; - t257 = t1636; - t258 = t1637; - continue loop; - } - } - }; - t256 = t1632; // set! t256 - var t1641 = SPOCK.check(t255, 'number', "list-tail"); - return t256(k1101, t1641, t254); - }; - ___list_2dtail = t1631; // set! list-tail - var t260 = ___list_2dtail; - var t1643 = function (k1103, t261, t262) { // t260 - var r = SPOCK.count(arguments, "t260"); - if(r) return r; - var t1644 = function (t1105) { - var t1645 = SPOCK.check(t1105, SPOCK.Pair); - var t1104 = t1645; - var t263 = t1104; - var t1646 = t263.car; - return k1103(t1646); - }; - return t260(t1644, t261, t262); - }; - ___list_2dref = t1643; // set! list-ref - var t1649 = function(K) { - SPOCK.count(arguments, 'memq'); - var x = arguments[ 1 ]; - for(var n = arguments[ 2 ]; n instanceof SPOCK.Pair; n = n.cdr) { - if(n.car === x) return K(n); - } - return K(false); - }; - ___memq = t1649; // set! memq - var t1650 = function(K) { - SPOCK.count(arguments, 'memv'); - var x = arguments[ 1 ]; - for(var n = arguments[ 2 ]; n instanceof SPOCK.Pair; n = n.cdr) { - if(SPOCK.eqvp(n.car, x)) return K(n); - } - return K(false); - }; - ___memv = t1650; // set! memv - var t1651 = function(K) { - SPOCK.count(arguments, 'member'); - var x = arguments[ 1 ]; - for(var n = arguments[ 2 ]; n instanceof SPOCK.Pair; n = n.cdr) { - if(SPOCK.equalp(n.car, x)) return K(n); - } - return K(false); - }; - ___member = t1651; // set! member - var t1652 = function(K) { - SPOCK.count(arguments, 'assq'); - var x = arguments[ 1 ]; - for(var n = arguments[ 2 ]; n instanceof SPOCK.Pair; n = n.cdr) { - var p = n.car; - if(p instanceof SPOCK.Pair && p.car === x) return K(p); - } - return K(false); - }; - ___assq = t1652; // set! assq - var t1653 = function(K) { - SPOCK.count(arguments, 'assv'); - var x = arguments[ 1 ]; - for(var n = arguments[ 2 ]; n instanceof SPOCK.Pair; n = n.cdr) { - var p = n.car; - if(p instanceof SPOCK.Pair && SPOCK.eqvp(p.car, x)) return K(p); - } - return K(false); - }; - ___assv = t1653; // set! assv - var t1654 = function(K) { - SPOCK.count(arguments, 'assoc'); - var x = arguments[ 1 ]; - for(var n = arguments[ 2 ]; n instanceof SPOCK.Pair; n = n.cdr) { - var p = n.car; - if(p instanceof SPOCK.Pair && SPOCK.equalp(p.car, x)) return K(p); - } - return K(false); - }; - ___assoc = t1654; // set! assoc - var t1655 = function(K) { - SPOCK.count(arguments, '%+'); - var len = arguments.length; - switch(len) { - case 1: return K(0); - case 2: return K(SPOCK.check(arguments[ 1 ], 'number', '+')); - default: - var p = SPOCK.check(arguments[ 1 ], 'number', '+'); - for(var i = 2; i < len; ++i) { - p += SPOCK.check(arguments[ i ], 'number', '+'); - } - return K(p);} - }; - ____25_2b = t1655; // set! %+ - var t1656 = function(K) { - SPOCK.count(arguments, '%-'); - var len = arguments.length; - switch(len) { - case 1: SPOCK.error('(-) bad argument count', len); - case 2: return K(-SPOCK.check(arguments[ 1 ], 'number', '-')); - default: - var p = SPOCK.check(arguments[ 1 ], 'number', '-'); - for(var i = 2; i < len; ++i) { - p -= SPOCK.check(arguments[ i ], 'number', '-'); - } - return K(p);} - }; - ____25_2d = t1656; // set! %- - var t1657 = function(K) { - SPOCK.count(arguments, '%*'); - var len = arguments.length; - switch(len) { - case 1: return K(1); - case 2: return K(SPOCK.check(arguments[ 1 ], 'number', '*')); - default: - var p = SPOCK.check(arguments[ 1 ], 'number', '*'); - for(var i = 2; i < len; ++i) { - p *= SPOCK.check(arguments[ i ], 'number', '*'); - } - return K(p);} - }; - ____25_2a = t1657; // set! %* - var t1658 = function(K) { - SPOCK.count(arguments, '%/'); - var len = arguments.length; - switch(len) { - case 1: SPOCK.error('(/) bad argument count', len); - case 2: return K(1/SPOCK.check(arguments[ 1 ], 'number', '/')); - default: - var p = SPOCK.check(arguments[ 1 ], 'number', '/'); - for(var i = 2; i < len; ++i) { - p /= SPOCK.check(arguments[ i ], 'number', '/'); - } - return K(p);} - }; - ____25_2f = t1658; // set! %/ - var t1659 = function(K) { - SPOCK.count(arguments, '%='); - var argc = arguments.length; - var last = SPOCK.check(arguments[ 1 ], 'number', '='); - for(var i = 2; i < argc; ++i) { - var x = SPOCK.check(arguments[ i ], 'number', '='); - if(last !== x) return K(false); - else last = x;} - return K(true); - }; - ____25_3d = t1659; // set! %= - var t1660 = function(K) { - SPOCK.count(arguments, '%>'); - var argc = arguments.length; - var last = SPOCK.check(arguments[ 1 ], 'number', '>'); - for(var i = 2; i < argc; ++i) { - var x = SPOCK.check(arguments[ i ], 'number', '>'); - if(last <= x) return K(false); - else last = x;} - return K(true); - }; - ____25_3e = t1660; // set! %> - var t1661 = function(K) { - SPOCK.count(arguments, '%<'); - var argc = arguments.length; - var last = SPOCK.check(arguments[ 1 ], 'number', '<'); - for(var i = 2; i < argc; ++i) { - var x = SPOCK.check(arguments[ i ], 'number', '<'); - if(last >= x) return K(false); - else last = x;} - return K(true); - }; - ____25_3c = t1661; // set! %< - var t1662 = function(K) { - SPOCK.count(arguments, '%>='); - var argc = arguments.length; - var last = SPOCK.check(arguments[ 1 ], 'number', '>='); - for(var i = 2; i < argc; ++i) { - var x = SPOCK.check(arguments[ i ], 'number', '>='); - if(last < x) return K(false); - else last = x;} - return K(true); - }; - ____25_3e_3d = t1662; // set! %>= - var t1663 = function(K) { - SPOCK.count(arguments, '%<='); - var argc = arguments.length; - var last = SPOCK.check(arguments[ 1 ], 'number', '<='); - for(var i = 2; i < argc; ++i) { - var x = SPOCK.check(arguments[ i ], 'number', '<='); - if(last > x) return K(false); - else last = x;} - return K(true); - }; - ____25_3c_3d = t1663; // set! %<= - var t1664 = function(K) { - SPOCK.count(arguments, '%max'); - var argc = arguments.length; - var n = SPOCK.check(arguments[ 1 ], 'number', 'max'); - for(var i = 2; i < argc; ++i) { - var x = SPOCK.check(arguments[ i ], 'number', 'max'); - if(n < x) n = x;} - return K(n); - }; - ____25max = t1664; // set! %max - var t1665 = function(K) { - SPOCK.count(arguments, '%min'); - var argc = arguments.length; - var n = SPOCK.check(arguments[ 1 ], 'number', 'max'); - for(var i = 2; i < argc; ++i) { - var x = SPOCK.check(arguments[ i ], 'number', 'max'); - if(n > x) n = x;} - return K(n); - }; - ____25min = t1665; // set! %min - var t1666 = function (k1106, t264, t265) { // modulo - var r = SPOCK.count(arguments, "modulo"); - if(r) return r; - loop: while(true) { - var t1668 = SPOCK.check(t264, 'number', "modulo"); - var t1669 = SPOCK.check(t265, 'number', "modulo"); - var t1667 = (t1668) / (t1669); - var t275 = t1667; - var t1670 = SPOCK.check(t275, 'number', "modulo"); - var t1672 = (t275) < 0 ; - var t1671; - if(t1672 !== false) { - var t1673 = Math.ceil(t275); - t1671 = t1673; - } - else { - var t1674 = Math.floor(t275); - t1671 = t1674; - } - var t271 = t1671; - var t1676 = SPOCK.check(t271, 'number', "modulo"); - var t1677 = SPOCK.check(t265, 'number', "modulo"); - var t1675 = (t1676) * (t1677); - var t270 = t1675; - var t1679 = SPOCK.check(t264, 'number', "modulo"); - var t1680 = SPOCK.check(t270, 'number', "modulo"); - var t1678 = (t1679) - (t1680); - var t266 = t1678; - var t1682 = SPOCK.check(t265, 'number', "modulo"); - var t1683 = SPOCK.check(0, 'number', "modulo"); - var t1681 = (t1682) < (t1683); - var t952 = t1681; - var t1684; - if(t952 !== false) { - var t1686 = SPOCK.check(t266, 'number', "modulo"); - var t1687 = SPOCK.check(0, 'number', "modulo"); - var t1685 = (t1686) <= (t1687); - var t953 = t1685; - var t1688; - if(t953 !== false) { - t1688 = t266; - } - else { - var t1690 = SPOCK.check(t266, 'number', "modulo"); - var t1691 = SPOCK.check(t265, 'number', "modulo"); - var t1689 = (t1690) + (t1691); - t1688 = t1689; - } - t1684 = t1688; - } - else { - var t1693 = SPOCK.check(t266, 'number', "modulo"); - var t1694 = SPOCK.check(0, 'number', "modulo"); - var t1692 = (t1693) >= (t1694); - var t954 = t1692; - var t1695; - if(t954 !== false) { - t1695 = t266; - } - else { - var t1697 = SPOCK.check(t266, 'number', "modulo"); - var t1698 = SPOCK.check(t265, 'number', "modulo"); - var t1696 = (t1697) + (t1698); - t1695 = t1696; - } - t1684 = t1695; - } - return k1106(t1684); - } - }; - ___modulo = t1666; // set! modulo - var t1700 = function (k1107, t289, t290) { // t288 - var r = SPOCK.count(arguments, "t288"); - if(r) return r; - loop: while(true) { - var t1702 = SPOCK.check(t289, 'number', "t288"); - var t1703 = SPOCK.check(t290, 'number', "t288"); - var t1701 = (t1702) / (t1703); - var t297 = t1701; - var t1704 = SPOCK.check(t297, 'number', "t288"); - var t1706 = (t297) < 0 ; - var t1705; - if(t1706 !== false) { - var t1707 = Math.ceil(t297); - t1705 = t1707; - } - else { - var t1708 = Math.floor(t297); - t1705 = t1708; - } - var t293 = t1705; - var t1710 = SPOCK.check(t293, 'number', "t288"); - var t1711 = SPOCK.check(t290, 'number', "t288"); - var t1709 = (t1710) * (t1711); - var t292 = t1709; - var t1713 = SPOCK.check(t289, 'number', "t288"); - var t1714 = SPOCK.check(t292, 'number', "t288"); - var t1712 = (t1713) - (t1714); - return k1107(t1712); - } - }; - var t288 = t1700; - var t1716 = function (k1108, t300, t301) { // t288 - var r = SPOCK.count(arguments, "t288"); - if(r) return r; - var t302 = undefined; - var t1717 = function (k1109, t303, t304) { // t302 - var r = SPOCK.count(arguments, "t302"); - if(r) return r; - var t1718 = SPOCK.check(t304, 'number', "t302"); - var t307 = t1718; - var t1719 = (0) === (t307); - var t955 = t1719; - var t1720; - if(t955 !== false) { - var t1722 = SPOCK.check(t303, 'number', "t302"); - var t1721 = Math.abs(t1722); - return k1109(t1721); - } - else { - var t1724 = function (t1110) { - return t302(k1109, t304, t1110); - }; - return t288(t1724, t303, t304); - } - }; - t302 = t1717; // set! t302 - return t302(k1108, t300, t301); - }; - ____25gcd = t1716; // set! %gcd - var t1728 = function (k1111, t309) { // gcd - var t309 = SPOCK.rest(arguments, 1, 'gcd'); - var t1730 = null; - var t1729 = (t309) === (t1730); - var t956 = t1729; - var t1731; - if(t956 !== false) { - return k1111(0); - } - else { - var t313 = undefined; - var t1733 = function (k1112, t314, t315) { // t313 - var r = SPOCK.count(arguments, "t313"); - if(r) return r; - var t1734 = t314.car; - var t316 = t1734; - var t1735 = t314.cdr; - var t317 = t1735; - var t1736; - if(t315 !== false) { - var t1737 = SPOCK.check(t316, 'number', "t313"); - t1736 = t1737; - } - else { - } - var t1739 = null; - var t1738 = (t317) === (t1739); - var t957 = t1738; - var t1740; - if(t957 !== false) { - var t1742 = SPOCK.check(t316, 'number', "t313"); - var t1741 = Math.abs(t1742); - return k1112(t1741); - } - else { - var t1744 = t317.car; - var t324 = t1744; - var t1745 = SPOCK.check(t324, 'number', "t313"); - var t1746 = function (t1114) { - var t326 = t1114; - var t1747 = t317.cdr; - var t327 = t1747; - var t1748 = new SPOCK.Pair(t326, t327); - var t1113 = t1748; - return t313(k1112, t1113, false); - }; - return ____25gcd(t1746, t316, t324); - } - }; - t313 = t1733; // set! t313 - return t313(k1111, t309, true); - } - }; - ___gcd = t1728; // set! gcd - var t1752 = function (k1115, t329, t330) { // %lcm - var r = SPOCK.count(arguments, "%lcm"); - if(r) return r; - var t1754 = SPOCK.check(t329, 'number', "%lcm"); - var t1755 = SPOCK.check(t330, 'number', "%lcm"); - var t1753 = (t1754) * (t1755); - var t331 = t1753; - var t1756 = function (t1116) { - var t332 = t1116; - var t1758 = SPOCK.check(t331, 'number'); - var t1759 = SPOCK.check(t332, 'number'); - var t1757 = (t1758) / (t1759); - var t335 = t1757; - var t1760 = SPOCK.check(t335, 'number'); - var t1762 = (t335) < 0 ; - var t1761; - if(t1762 !== false) { - var t1763 = Math.ceil(t335); - t1761 = t1763; - } - else { - var t1764 = Math.floor(t335); - t1761 = t1764; - } - return k1115(t1761); - }; - return ____25gcd(t1756, t329, t330); - }; - ____25lcm = t1752; // set! %lcm - var t1767 = function (k1117, t338) { // lcm - var t338 = SPOCK.rest(arguments, 1, 'lcm'); - var t1769 = null; - var t1768 = (t338) === (t1769); - var t958 = t1768; - var t1770; - if(t958 !== false) { - return k1117(1); - } - else { - var t342 = undefined; - var t1772 = function (k1118, t343, t344) { // t342 - var r = SPOCK.count(arguments, "t342"); - if(r) return r; - var t1773 = t343.car; - var t345 = t1773; - var t1774 = t343.cdr; - var t346 = t1774; - var t1775; - if(t344 !== false) { - var t1776 = SPOCK.check(t345, 'number', "t342"); - t1775 = t1776; - } - else { - } - var t1778 = null; - var t1777 = (t346) === (t1778); - var t959 = t1777; - var t1779; - if(t959 !== false) { - var t1781 = SPOCK.check(t345, 'number', "t342"); - var t1780 = Math.abs(t1781); - return k1118(t1780); - } - else { - var t1783 = t346.car; - var t353 = t1783; - var t1784 = SPOCK.check(t353, 'number', "t342"); - var t1785 = function (t1120) { - var t355 = t1120; - var t1786 = t346.cdr; - var t356 = t1786; - var t1787 = new SPOCK.Pair(t355, t356); - var t1119 = t1787; - return t342(k1118, t1119, false); - }; - return ____25lcm(t1785, t345, t353); - } - }; - t342 = t1772; // set! t342 - return t342(k1117, t338, true); - } - }; - ___lcm = t1767; // set! lcm - var t1791 = function(K) { - SPOCK.count(arguments, 'string->symbol'); - var str = SPOCK.jstring(arguments[ 1 ]); - return K(SPOCK.intern(str)); - }; - ___string_2d_3esymbol = t1791; // set! string->symbol - var t1792 = function (k1121, t358, t359) { // get - var r = SPOCK.count(arguments, "get"); - if(r) return r; - loop: while(true) { - var t1794 = SPOCK.check(t358, SPOCK.Symbol, "get"); - var t1796 = SPOCK.check(t359, SPOCK.Symbol, "get"); - var t1795 = t1796.name; - var t1793 = (t1794) .plist[ (t1795) ] ; - var t360 = t1793; - var t1797 = t360 === undefined; - var t361 = t1797; - var t1798; - if(t361 !== false) { - t1798 = false; - } - else { - t1798 = true; - } - var t960 = t1798; - var t1799; - if(t960 !== false) { - t1799 = t360; - } - else { - t1799 = false; - } - return k1121(t1799); - } - }; - ___get = t1792; // set! get - var t1801 = function (k1122, t363, t364, t365) { // put! - var r = SPOCK.count(arguments, "put!"); - if(r) return r; - loop: while(true) { - var t1803 = SPOCK.check(t363, SPOCK.Symbol, "put!"); - var t1805 = SPOCK.check(t364, SPOCK.Symbol, "put!"); - var t1804 = t1805.name; - var t1802 = (t1803) .plist[ (t1804) ] = (t365); - return k1122(t1802); - } - }; - ___put_21 = t1801; // set! put! - var t1807 = function(K) { - SPOCK.count(arguments, 'string-append'); - var args = Array.prototype.slice.call(arguments, 1); - var strs = SPOCK.map(function(x) { return SPOCK.jstring(x); }, args); - return K(new SPOCK.String(strs)); - }; - ___string_2dappend = t1807; // set! string-append - var t1808 = function(K) { - SPOCK.count(arguments, 'string'); - var str = []; - var len = arguments.length - 1; - for(var i = 1; i <= len; ++i) { - var x = arguments[ i ]; - if(x instanceof SPOCK.Char) str.push(x.character); - else SPOCK.error('bad argument type - not a character', x);} - return K(new SPOCK.String(str.join(''))); - }; - ___string = t1808; // set! string - var t1809 = function(K) { - SPOCK.count(arguments, 'string->list'); - var str = SPOCK.jstring(arguments[ 1 ]); - var lst = null; - var len = str.length; - for(var i = len - 1; i >= 0; --i) - lst = new SPOCK.Pair(new SPOCK.Char(str.charAt(i)), lst); - return K(lst); - }; - ___string_2d_3elist = t1809; // set! string->list - var t1810 = function(K) { - SPOCK.count(arguments, 'list->string'); - var lst = arguments[ 1 ]; - var str = []; - while(lst instanceof SPOCK.Pair) { - str.push(SPOCK.check(lst.car, SPOCK.Char).character); - lst = lst.cdr;} - return K(new SPOCK.String(str.join(''))); - }; - ___list_2d_3estring = t1810; // set! list->string - var t1811 = function(K) { - SPOCK.count(arguments, 'make-string'); - var n = SPOCK.check(arguments[ 1 ], 'number', 'make-string'); - var c = arguments[ 2 ]; - var a = new Array(n); - if(c !== undefined) - c = SPOCK.check(c, SPOCK.Char, 'make-string').character; - else c = ' '; - for(var i = 0; i < n; ++i) a[ i ] = c; - return K(new SPOCK.String(a.join(''))); - }; - ___make_2dstring = t1811; // set! make-string - var t1812 = function(K) { - SPOCK.count(arguments, 'string-ref'); - var str = arguments[ 1 ]; - var i = SPOCK.check(arguments[ 2 ], 'number', 'string-ref'); - if(typeof str === 'string') - return K(new SPOCK.Char(str.charAt(i))); - else if(str instanceof SPOCK.String) { - var parts = str.parts; - for(var p in parts) { - var l = parts[ p ].length; - if(i <= l) return K(new SPOCK.Char(parts[ p ].charAt(i))); - else i -= l;} - SPOCK.error('`string-ref\' out of range', str, i);} - }; - ___string_2dref = t1812; // set! string-ref - var t1813 = function(K) { - SPOCK.count(arguments, 'string-set!'); - var str = arguments[ 1 ]; - var i = SPOCK.check(arguments[ 2 ], 'number', 'string-set!'); - var c = SPOCK.check(arguments[ 3 ], SPOCK.Char, 'string-set!'); - if(typeof str === 'string') - SPOCK.error('argument to `string-set!\' is not a mutable string', str); - else if(str instanceof SPOCK.String) { - var parts = str.parts; - for(var p in parts) { - var part = parts[ p ]; - var l = part.length; - if(i <= l) { - parts[ p ] = part.substring(0, i) + c.character + part.substring(i + 1); - return K(undefined); - } else i -= l;} - SPOCK.error('`string-set!\' out of range', str, i);} - }; - ___string_2dset_21 = t1813; // set! string-set! - var t1814 = function (k1123, t366, t367, t368) { // string-copy - var r = SPOCK.count(arguments, "string-copy"); - if(r) return r; - loop: while(true) { - var t1815 = SPOCK.jstring(t366); - var t369 = t1815; - var t1816 = t367 === undefined; - var t961 = t1816; - var t1817; - if(t961 !== false) { - t1817 = 0; - } - else { - var t1818 = SPOCK.check(t367, 'number', "string-copy"); - t1817 = t1818; - } - var t371 = t1817; - var t1819 = t368 === undefined; - var t962 = t1819; - var t1820; - if(t962 !== false) { - var t1821 = t369.length; - t1820 = t1821; - } - else { - var t1822 = SPOCK.check(t368, 'number', "string-copy"); - t1820 = t1822; - } - var t373 = t1820; - var t1823 = t369.slice(t371, t373); - var t375 = t1823; - var t1824 = new SPOCK.String(t375); - return k1123(t1824); - } - }; - ___string_2dcopy = t1814; // set! string-copy - var t1826 = function (k1124, t376, t377, t378, t379) { // string-fill! - var r = SPOCK.count(arguments, "string-fill!"); - if(r) return r; - var t1827 = (t376) instanceof SPOCK.String ; - var t380 = t1827; - var t1828; - if(t380 !== false) { - t1828 = false; - } - else { - t1828 = true; - } - var t963 = t1828; - var t1829 = function (t1125) { // t1126 - var t1830 = t376.normalize(); - var t381 = t1830; - var t1831 = SPOCK.check(t377, SPOCK.Char, "t1126"); - var t382 = t1831; - var t1832 = t378 === undefined; - var t964 = t1832; - var t1833; - if(t964 !== false) { - t1833 = 0; - } - else { - var t1834 = SPOCK.check(t378, 'number', "t1126"); - t1833 = t1834; - } - var t383 = t1833; - var t1835 = t379 === undefined; - var t965 = t1835; - var t1836; - if(t965 !== false) { - var t1837 = t381.length; - t1836 = t1837; - } - else { - var t1838 = SPOCK.check(t379, 'number', "t1126"); - t1836 = t1838; - } - var t385 = t1836; - var t1839 = function(K) { - SPOCK.count(arguments); - var str = arguments[ 1 ]; - var from = arguments[ 2 ]; - var to = arguments[ 3 ]; - var c = arguments[ 4 ]; - var snew = new Array(to - from); - for(var i in snew) snew[ i ] = c; - str.parts = [str.parts[ 0 ].substring(0, from), snew.join(''), - str.parts[ 0 ].substring(to)]; - return K(str); - }; - return t1839(k1124, t376, t383, t385, t382); - }; - var t1126 = t1829; - var t1841; - if(t963 !== false) { - return ____25error(t1126, "bad argument type - not a mutable string", t376); - } - else { - return t1126(undefined); - } - }; - ___string_2dfill_21 = t1826; // set! string-fill! - var t1844 = function(K) { - SPOCK.count(arguments, 'vector'); - return K(Array.prototype.slice.call(arguments, 1)); - }; - ___vector = t1844; // set! vector - var t1845 = function(K) { - SPOCK.count(arguments, 'make-vector'); - var n = SPOCK.check(arguments[ 1 ], 'number', 'make-vector'); - var x = arguments[ 2 ]; - var a = new Array(n); - if(x !== undefined) { - for(var i = 0; i < n; ++i) a[ i ] = x;} - return K(a); - }; - ___make_2dvector = t1845; // set! make-vector - var t1846 = function(K) { - SPOCK.count(arguments, 'vector->list'); - var vec = SPOCK.check(arguments[ 1 ], Array, 'vector->list'); - var lst = null; - var len = vec.length; - for(var i = len - 1; i >= 0; --i) - lst = new SPOCK.Pair(vec[ i ], lst); - return K(lst); - }; - ___vector_2d_3elist = t1846; // set! vector->list - var t1847 = function(K) { - SPOCK.count(arguments, 'list->vector'); - var lst = arguments[ 1 ]; - var vec = []; - while(lst instanceof SPOCK.Pair) { - vec.push(lst.car); - lst = lst.cdr;} - return K(vec); - }; - ___list_2d_3evector = t1847; // set! list->vector - var t1848 = function(K) { - SPOCK.count(arguments, 'vector-fill!'); - var vec = SPOCK.check(arguments[ 1 ], Array, 'vector-fill!'); - var x = arguments[ 2 ]; - var from = arguments[ 3 ]; - var to = arguments[ 4 ]; - if(from === undefined) from = 0; - if(to === undefined) to = vec.length; - for(var i = from; i < to; ++i) - vec[ i ] = x; - return K(undefined); - }; - ___vector_2dfill_21 = t1848; // set! vector-fill! - var t1849 = function(K) { - SPOCK.count(arguments, 'string->number'); - var str = SPOCK.jstring(arguments[ 1 ]); - var base = arguments[ 2 ]; - if(!base) base = 10; - else base = SPOCK.check(base, 'number', 'string->number'); - var m = true, neg = 1; - while(m) { - m = str.match(/^#[eboxid]/); - if(m) { - switch(str[ 1 ]) { - case 'e': - case 'i': break; - case 'd': base = 10; break; - case 'o': base = 8; break; - case 'x': base = 16; break; - case 'b': base = 2; break; - default: return K(false);} - str = str.substring(2);}} - switch(str[ 0 ]) { - case '-': neg = -1; str = str.substring(1); break; - case '+': str = str.substring(1);} - var num, den = false; - if((m = str.match(/^([^\/]+)\/(.+)$/))) { - str = m[ 1 ]; - den = m[ 2 ];} - function num3(s) { - var tr = null; - switch(base) { - case 2: tr = /^[0-1]+$/; break; - case 8: tr = /^[0-7]+$/; break; - case 10: tr = /^[#0-9]*\.?[#0-9]+([esdfl][-+]?[0-9]+)?$/; break; - case 16: tr = /^[0-9a-fA-F]+$/;} - if(tr && !s.match(tr)) return false; - var s2 = s.replace(/#/g, '0'); - if(base === 10) s2 = parseFloat(s2.replace(/[esdfl]/g, 'e')); - else if(s2 !== s) return false; - else s2 = parseInt(s2, base); - return isNaN(s2) ? false : s2;} - if((num = num3(str)) === false) return K(false); - if(den && !(den = num3(den))) return K(false); - return K(neg * num / (den || 1)); - }; - ___string_2d_3enumber = t1849; // set! string->number - var t1850 = function(K) { - SPOCK.count(arguments, '%show'); - arguments[ 2 ].write(arguments[ 1 ]); - return K(undefined); - }; - ____25show = t1850; // set! %show - var t1851 = function(K) { - SPOCK.count(arguments, '%fetch'); - return K(arguments[ 2 ].read(arguments[ 1 ])); - }; - ____25fetch = t1851; // set! %fetch - var t1852 = function(K) { - SPOCK.count(arguments, '%check-port'); - var port = arguments[ 1 ]; - var dir = arguments[ 2 ]; - if(port instanceof SPOCK.Port) { - if(port.closed) - SPOCK.error('port is already closed', port); - else if(port.direction !== dir) - SPOCK.error('bad argument type - not an ' + dir + ' port', port, arguments[ 3 ]); - } - else SPOCK.error('bad argument type - not a port', port, arguments[ 3 ]); - return K(port); - }; - ____25check_2dport = t1852; // set! %check-port - var t1853 = function (k1127, t387) { // newline - var r = SPOCK.count(arguments, "newline"); - if(r) return r; - var t1854 = t387 === undefined; - var t966 = t1854; - var t1855 = function (t1128) { // t1129 - return ____25show(k1127, "\n", t1128); - }; - var t1129 = t1855; - var t1857; - if(t966 !== false) { - return t1129(SPOCK.stdout); - } - else { - return ____25check_2dport(t1129, t387, "output", "newline"); - } - }; - ___newline = t1853; // set! newline - var t1860 = function (k1130, t389) { // read-char - var r = SPOCK.count(arguments, "read-char"); - if(r) return r; - var t1861 = t389 === undefined; - var t967 = t1861; - var t1862 = function (t1132) { // t1133 - var t1863 = function (t1131) { - var t390 = t1131; - var t394 = SPOCK.EOF; - var t1864 = (t390) === (t394); - var t968 = t1864; - var t1865; - if(t968 !== false) { - t1865 = t390; - } - else { - var t1866 = new SPOCK.Char(t390); - t1865 = t1866; - } - return k1130(t1865); - }; - return ____25fetch(t1863, 1, t1132); - }; - var t1133 = t1862; - var t1869; - if(t967 !== false) { - return t1133(SPOCK.stdin); - } - else { - return ____25check_2dport(t1133, t389, "input", "read-char"); - } - }; - ___read_2dchar = t1860; // set! read-char - var t1872 = function (k1134, t395, t396) { // write-char - var r = SPOCK.count(arguments, "write-char"); - if(r) return r; - var t1873 = t396 === undefined; - var t969 = t1873; - var t1874 = function (t1135) { // t1136 - var t1876 = SPOCK.check(t395, SPOCK.Char, "t1136"); - var t1875 = t1876.character; - return ____25show(k1134, t1875, t1135); - }; - var t1136 = t1874; - var t1878; - if(t969 !== false) { - return t1136(SPOCK.stdout); - } - else { - return ____25check_2dport(t1136, t396, "output", "write-char"); - } - }; - ___write_2dchar = t1872; // set! write-char - var t398 = ___read_2dchar; - var t1881 = function (k1137, t399) { // t398 - var r = SPOCK.count(arguments, "t398"); - if(r) return r; - var t1882 = function (t1138) { - var t400 = t1138; - var t404 = SPOCK.EOF; - var t1883 = (t400) === (t404); - var t401 = t1883; - var t1884; - if(t401 !== false) { - t1884 = false; - } - else { - t1884 = true; - } - var t970 = t1884; - var t1885; - if(t970 !== false) { - var t1887 = t400.character; - var t1886 = (t399) .peeked = (t1887); - t1885 = t1886; - } - else { - } - return k1137(t400); - }; - return t398(t1882, t399); - }; - ___peek_2dchar = t1881; // set! peek-char - var t1890 = function (k1139, t405) { // char-ready? - var r = SPOCK.count(arguments, "char-ready?"); - if(r) return r; - var t1891 = function (t1140) { - var t1892 = t405.ready(); - return k1139(t1892); - }; - return ____25check_2dport(t1891, t405, "input", "char-ready?"); - }; - ___char_2dready_3f = t1890; // set! char-ready? - var t1895 = function (k1141, t406, t407, t408) { // %print-hook - var r = SPOCK.count(arguments, "%print-hook"); - if(r) return r; - return ____25show(k1141, "#<unknown object>", t407); - }; - ____25print_2dhook = t1895; // set! %print-hook - var t1897 = function (k1142, t409, t410) { // display - var r = SPOCK.count(arguments, "display"); - if(r) return r; - var t1898 = t410 === undefined; - var t971 = t1898; - var t1899 = function (t1143) { // t1157 - var t411 = t1143; - var t413 = undefined; - var t1900 = function (k1144, t414) { // t413 - var r = SPOCK.count(arguments, "t413"); - if(r) return r; - var t1902 = null; - var t1901 = (t414) === (t1902); - var t972 = t1901; - var t1903; - if(t972 !== false) { - return ____25show(k1144, "()", t411); - } - else { - var t1905 = typeof(t414); - var t419 = t1905; - var t1906 = (t419) === ("number"); - var t973 = t1906; - var t1907; - if(t973 !== false) { - var t1910 = SPOCK.check(t414, 'number', "t413"); - var t1911 = undefined === undefined; - var t974 = t1911; - var t1912; - if(t974 !== false) { - t1912 = 10; - } - else { - var t1913 = SPOCK.check(undefined, 'number', "t413"); - t1912 = t1913; - } - var t1909 = t1910.toString(t1912); - var t1908 = new SPOCK.String(t1909); - var t421 = t1908; - var t1914 = SPOCK.jstring(t421); - return ____25show(k1144, t1914, t411); - } - else { - var t1916 = typeof(t414); - var t427 = t1916; - var t1917 = (t427) === ("string"); - var t426 = t1917; - var t1918; - if(t426 !== false) { - t1918 = t426; - } - else { - var t1919 = (t414) instanceof SPOCK.String ; - t1918 = t1919; - } - var t975 = t1918; - var t1920; - if(t975 !== false) { - var t1921 = SPOCK.jstring(t414); - return ____25show(k1144, t1921, t411); - } - else { - var t1923 = (t414) instanceof SPOCK.Symbol ; - var t976 = t1923; - var t1924; - if(t976 !== false) { - var t1925 = t414.name; - return ____25show(k1144, t1925, t411); - } - else { - var t1927 = (t414) instanceof SPOCK.Char ; - var t977 = t1927; - var t1928; - if(t977 !== false) { - var t1929 = t414.character; - return ____25show(k1144, t1929, t411); - } - else { - var t433 = SPOCK.EOF; - var t1931 = (t414) === (t433); - var t978 = t1931; - var t1932; - if(t978 !== false) { - return ____25show(k1144, "#<eof>", t411); - } - else { - var t1934 = typeof(t414); - var t435 = t1934; - var t1935 = (t435) === ("function"); - var t979 = t1935; - var t1936; - if(t979 !== false) { - return ____25show(k1144, "#<procedure>", t411); - } - else { - var t1938 = (t414) === (true); - var t438 = t1938; - var t1939; - if(t438 !== false) { - t1939 = t438; - } - else { - var t1940 = (t414) === (false); - t1939 = t1940; - } - var t980 = t1939; - var t1941; - if(t980 !== false) { - var t1942; - if(t414 !== false) { - t1942 = "#t"; - } - else { - t1942 = "#f"; - } - return ____25show(k1144, t1942, t411); - } - else { - var t1944 = (t414) instanceof SPOCK.Pair ; - var t981 = t1944; - var t1945; - if(t981 !== false) { - var t1946 = function (t1145) { - var t444 = undefined; - var t1947 = function (k1146, t445) { // t444 - var r = SPOCK.count(arguments, "t444"); - if(r) return r; - var t1949 = null; - var t1948 = (t445) === (t1949); - var t982 = t1948; - var t1950; - if(t982 !== false) { - return ____25show(k1146, ")", t411); - } - else { - var t1952 = (t445) instanceof SPOCK.Pair ; - var t449 = t1952; - var t1953; - if(t449 !== false) { - t1953 = false; - } - else { - t1953 = true; - } - var t983 = t1953; - var t1954; - if(t983 !== false) { - var t1955 = function (t1147) { - var t1956 = function (t1148) { - return ____25show(k1146, ")", t411); - }; - return t413(t1956, t445); - }; - return ____25show(t1955, " . ", t411); - } - else { - var t452 = t414; - var t1960 = (t452) === (t445); - var t451 = t1960; - var t1961; - if(t451 !== false) { - t1961 = false; - } - else { - t1961 = true; - } - var t984 = t1961; - var t1962 = function (t1149) { // t1151 - var t1963 = function (t1150) { - var t1964 = SPOCK.check(t445, SPOCK.Pair); - var t456 = t1964; - var t1965 = t456.cdr; - return t444(k1146, t1965); - }; - var t1967 = t445.car; - return t413(t1963, t1967); - }; - var t1151 = t1962; - var t1969; - if(t984 !== false) { - return ____25show(t1151, " ", t411); - } - else { - return t1151(undefined); - } - t1954 = t1969; - } - t1950 = t1954; - } - }; - t444 = t1947; // set! t444 - return t444(k1144, t414); - }; - return ____25show(t1946, "(", t411); - } - else { - var t1974 = t414 === undefined; - var t985 = t1974; - var t1975; - if(t985 !== false) { - return ____25show(k1144, "#<undefined>", t411); - } - else { - var t1977 = (t414) instanceof Array ; - var t986 = t1977; - var t1978; - if(t986 !== false) { - var t1979 = t414.length; - var t459 = t1979; - var t1980 = function (t1152) { - var t460 = undefined; - var t1981 = function (k1153, t461) { // t460 - var r = SPOCK.count(arguments, "t460"); - if(r) return r; - var t1983 = (t461) >= (t459); - var t1982; - if(t1983 !== false) { - return ____25show(k1153, ")", t411); - } - else { - var t1985 = (t461) === (0); - var t462 = t1985; - var t1986; - if(t462 !== false) { - t1986 = false; - } - else { - t1986 = true; - } - var t987 = t1986; - var t1987 = function (t1154) { // t1156 - var t1988 = function (t1155) { - var t1989 = 1+ (t461); - return t460(k1153, t1989); - }; - var t1991 = (t414) [ (t461) ] ; - return t413(t1988, t1991); - }; - var t1156 = t1987; - var t1993; - if(t987 !== false) { - return ____25show(t1156, " ", t411); - } - else { - return t1156(undefined); - } - t1982 = t1993; - } - }; - t460 = t1981; // set! t460 - return t460(k1144, 0); - }; - return ____25show(t1980, "#(", t411); - } - else { - var t1999 = (t414) instanceof SPOCK.Port ; - var t1998; - if(t1999 !== false) { - var t2000 = SPOCK.stringify(t414); - return ____25show(k1144, t2000, t411); - } - else { - var t2003 = (t414) instanceof SPOCK.Promise ; - var t2002; - if(t2003 !== false) { - return ____25show(k1144, "#<promise>", t411); - } - else { - var t2005 = typeof(t414); - var t466 = t2005; - var t2006 = ("object") === (t466); - var t988 = t2006; - var t2007; - if(t988 !== false) { - return ____25print_2dhook(k1144, t414, t411, false); - } - else { - return ____25show(k1144, "#<unknown object>", t411); - } - t2002 = t2007; - } - t1998 = t2002; - } - t1978 = t1998; - } - t1975 = t1978; - } - t1945 = t1975; - } - t1941 = t1945; - } - t1936 = t1941; - } - t1932 = t1936; - } - t1928 = t1932; - } - t1924 = t1928; - } - t1920 = t1924; - } - t1907 = t1920; - } - t1903 = t1907; - } - }; - t413 = t1900; // set! t413 - return t413(k1142, t409); - }; - var t1157 = t1899; - var t2011; - if(t971 !== false) { - return t1157(SPOCK.stdout); - } - else { - return ____25check_2dport(t1157, t410, "output", "display"); - } - }; - ___display = t1897; // set! display - var t467 = ___display; - var t468 = undefined; - var t2014 = function(K) { - SPOCK.count(arguments, 't468'); - var str = arguments[ 1 ]; - var a = []; - var len = str.length; - for(var i = 0; i < len; ++i) { - var c = str.charAt(i); - switch(c) { - case '\n': a.push('\n'); break; - case '\t': a.push('\t'); break; - case '\r': a.push('\r'); break; - case '\"': a.push('\\"'); break; - case '\\': a.push('\\'); break; - default: a.push(c);}} - return K(a.join('')); - }; - t468 = t2014; // set! t468 - var t2015 = function (k1158, t469, t470) { - var r = SPOCK.count(arguments); - if(r) return r; - var t2016 = t470 === undefined; - var t989 = t2016; - var t2017 = function (t1159) { // t1177 - var t471 = t1159; - var t473 = undefined; - var t2018 = function (k1160, t474) { // t473 - var r = SPOCK.count(arguments, "t473"); - if(r) return r; - var t2019 = typeof(t474); - var t477 = t2019; - var t2020 = (t477) === ("string"); - var t476 = t2020; - var t2021; - if(t476 !== false) { - t2021 = t476; - } - else { - var t2022 = (t474) instanceof SPOCK.String ; - t2021 = t2022; - } - var t990 = t2021; - var t2023; - if(t990 !== false) { - var t2024 = function (t1161) { - var t2025 = function (t1163) { - var t2026 = function (t1162) { - return ____25show(k1160, "\"", t471); - }; - return ____25show(t2026, t1163, t471); - }; - var t2029 = SPOCK.jstring(t474); - return t468(t2025, t2029); - }; - return ____25show(t2024, "\"", t471); - } - else { - var t2032 = (t474) instanceof SPOCK.Char ; - var t991 = t2032; - var t2033; - if(t991 !== false) { - var t2034 = function (t1164) { - var t2035 = t474.character; - var t480 = t2035; - var t2037 = SPOCK.eqvp(t480, "\n"); - var t992 = t2037; - var t2038; - if(t992 !== false) { - t2038 = true; - } - else { - t2038 = false; - } - var t2036; - if(t2038 !== false) { - t2036 = "newline"; - } - else { - var t2040 = SPOCK.eqvp(t480, "\r"); - var t993 = t2040; - var t2041; - if(t993 !== false) { - t2041 = true; - } - else { - t2041 = false; - } - var t2039; - if(t2041 !== false) { - t2039 = "return"; - } - else { - var t2043 = SPOCK.eqvp(t480, "\t"); - var t994 = t2043; - var t2044; - if(t994 !== false) { - t2044 = true; - } - else { - t2044 = false; - } - var t2042; - if(t2044 !== false) { - t2042 = "tab"; - } - else { - var t2046 = SPOCK.eqvp(t480, " "); - var t995 = t2046; - var t2047; - if(t995 !== false) { - t2047 = true; - } - else { - t2047 = false; - } - var t2045; - if(t2047 !== false) { - t2045 = "space"; - } - else { - t2045 = t480; - } - t2042 = t2045; - } - t2039 = t2042; - } - t2036 = t2039; - } - return ____25show(k1160, t2036, t471); - }; - return ____25show(t2034, "#\\", t471); - } - else { - var t2050 = (t474) instanceof SPOCK.Pair ; - var t996 = t2050; - var t2051; - if(t996 !== false) { - var t2052 = function (t1165) { - var t491 = undefined; - var t2053 = function (k1166, t492) { // t491 - var r = SPOCK.count(arguments, "t491"); - if(r) return r; - var t2055 = null; - var t2054 = (t492) === (t2055); - var t997 = t2054; - var t2056; - if(t997 !== false) { - return ____25show(k1166, ")", t471); - } - else { - var t2058 = (t492) instanceof SPOCK.Pair ; - var t496 = t2058; - var t2059; - if(t496 !== false) { - t2059 = false; - } - else { - t2059 = true; - } - var t998 = t2059; - var t2060; - if(t998 !== false) { - var t2061 = function (t1167) { - var t2062 = function (t1168) { - return ____25show(k1166, ")", t471); - }; - return t473(t2062, t492); - }; - return ____25show(t2061, " . ", t471); - } - else { - var t499 = t474; - var t2066 = (t499) === (t492); - var t498 = t2066; - var t2067; - if(t498 !== false) { - t2067 = false; - } - else { - t2067 = true; - } - var t999 = t2067; - var t2068 = function (t1169) { // t1171 - var t2069 = function (t1170) { - var t2070 = SPOCK.check(t492, SPOCK.Pair); - var t503 = t2070; - var t2071 = t503.cdr; - return t491(k1166, t2071); - }; - var t2073 = t492.car; - return t473(t2069, t2073); - }; - var t1171 = t2068; - var t2075; - if(t999 !== false) { - return ____25show(t1171, " ", t471); - } - else { - return t1171(undefined); - } - t2060 = t2075; - } - t2056 = t2060; - } - }; - t491 = t2053; // set! t491 - return t491(k1160, t474); - }; - return ____25show(t2052, "(", t471); - } - else { - var t2080 = (t474) instanceof Array ; - var t1000 = t2080; - var t2081; - if(t1000 !== false) { - var t2082 = t474.length; - var t505 = t2082; - var t2083 = function (t1172) { - var t506 = undefined; - var t2084 = function (k1173, t507) { // t506 - var r = SPOCK.count(arguments, "t506"); - if(r) return r; - var t2086 = (t507) >= (t505); - var t2085; - if(t2086 !== false) { - return ____25show(k1173, ")", t471); - } - else { - var t2088 = (t507) === (0); - var t508 = t2088; - var t2089; - if(t508 !== false) { - t2089 = false; - } - else { - t2089 = true; - } - var t1001 = t2089; - var t2090 = function (t1174) { // t1176 - var t2091 = function (t1175) { - var t2092 = 1+ (t507); - return t506(k1173, t2092); - }; - var t2094 = (t474) [ (t507) ] ; - return t473(t2091, t2094); - }; - var t1176 = t2090; - var t2096; - if(t1001 !== false) { - return ____25show(t1176, " ", t471); - } - else { - return t1176(undefined); - } - t2085 = t2096; - } - }; - t506 = t2084; // set! t506 - return t506(k1160, 0); - }; - return ____25show(t2083, "#(", t471); - } - else { - return t467(k1160, t474, t471); - } - t2051 = t2081; - } - t2033 = t2051; - } - t2023 = t2033; - } - }; - t473 = t2018; // set! t473 - return t473(k1158, t469); - }; - var t1177 = t2017; - var t2103; - if(t989 !== false) { - return t1177(SPOCK.stdout); - } - else { - return ____25check_2dport(t1177, t470, "output", "write"); - } - }; - ___write = t2015; // set! write - var t2106 = function(K) { - SPOCK.count(arguments, 'apply'); - var proc = arguments[ 1 ]; - var argc = arguments.length; - var lst = arguments[ argc - 1 ]; - var vec = [K].concat(Array.prototype.slice.call(arguments, 2, argc - 1)); - if(lst instanceof Array) vec = vec.concat(lst); - else{ - var len = SPOCK.length(lst); - var vec2 = new Array(len); - for(var i = 0; lst instanceof SPOCK.Pair; lst = lst.cdr) - vec2[ i++ ] = lst.car; - vec = vec.concat(vec2);} - return proc.apply(SPOCK.global, vec); - }; - ___apply = t2106; // set! apply - var t2107 = function (k1178, t511, t512, t513) { // for-each - var r = SPOCK.count(arguments, "for-each"); - if(r) return r; - var t513 = SPOCK.rest(arguments, 3, 'for-each'); - var t2109 = null; - var t2108 = (t513) === (t2109); - var t1002 = t2108; - var t2110; - if(t1002 !== false) { - var t2111 = (t512) instanceof Array ; - var t1003 = t2111; - var t2112; - if(t1003 !== false) { - var t2114 = SPOCK.check(t512, Array, "for-each"); - var t2113 = t2114.length; - var t518 = t2113; - var t520 = undefined; - var t2115 = function (k1179, t521) { // t520 - var r = SPOCK.count(arguments, "t520"); - if(r) return r; - var t523 = t518; - var t2117 = SPOCK.check(t521, 'number', "t520"); - var t2118 = SPOCK.check(t523, 'number', "t520"); - var t2116 = (t2117) >= (t2118); - var t1004 = t2116; - var t2119; - if(t1004 !== false) { - return k1179(false); - } - else { - var t2121 = function (t1180) { - var t2123 = SPOCK.check(t521, 'number'); - var t2124 = SPOCK.check(1, 'number'); - var t2122 = (t2123) + (t2124); - return t520(k1179, t2122); - }; - var t524 = t512; - var t2127 = SPOCK.check(t524, Array, "t520"); - var t2128 = SPOCK.check(t521, 'number', "t520"); - var t2126 = (t2127) [ (t2128) ] ; - return t511(t2121, t2126); - } - }; - t520 = t2115; // set! t520 - return t520(k1178, 0); - } - else { - var t528 = undefined; - var t2131 = function (k1181, t529) { // t528 - var r = SPOCK.count(arguments, "t528"); - if(r) return r; - var t2132 = (t529) instanceof SPOCK.Pair ; - var t1005 = t2132; - var t2133; - if(t1005 !== false) { - var t2134 = function (t1182) { - var t2135 = t529.cdr; - return t528(k1181, t2135); - }; - var t2137 = t529.car; - return t511(t2134, t2137); - } - else { - return k1181(undefined); - } - }; - t528 = t2131; // set! t528 - return t528(k1178, t512); - } - t2110 = t2112; - } - else { - var t533 = undefined; - var t2141 = function (k1183, t534) { // t533 - var r = SPOCK.count(arguments, "t533"); - if(r) return r; - var t536 = undefined; - var t2142 = function (k1189, t537) { // t536 - var r = SPOCK.count(arguments, "t536"); - if(r) return r; - var t2144 = null; - var t2143 = (t537) === (t2144); - var t1006 = t2143; - var t2145; - if(t1006 !== false) { - var t2146 = null; - return k1189(t2146); - } - else { - var t2148 = t537.car; - var t541 = t2148; - var t2149 = (t541) instanceof SPOCK.Pair ; - var t1007 = t2149; - var t2150; - if(t1007 !== false) { - var t2151 = t541.car; - var t544 = t2151; - var t2152 = function (t1190) { - var t545 = t1190; - var t2153 = new SPOCK.Pair(t544, t545); - return k1189(t2153); - }; - var t2155 = t537.cdr; - return t536(t2152, t2155); - } - else { - return k1189(false); - } - t2145 = t2150; - } - }; - t536 = t2142; // set! t536 - var t2158 = function (t1184) { - var t535 = t1184; - var t2159; - if(t535 !== false) { - var t2160 = function (t1185) { - var t548 = undefined; - var t2161 = function (k1187, t549) { // t548 - var r = SPOCK.count(arguments, "t548"); - if(r) return r; - var t2163 = null; - var t2162 = (t549) === (t2163); - var t1008 = t2162; - var t2164; - if(t1008 !== false) { - var t2165 = null; - return k1187(t2165); - } - else { - var t2167 = t549.car; - var t555 = t2167; - var t2168 = t555.cdr; - var t553 = t2168; - var t2169 = function (t1188) { - var t554 = t1188; - var t2170 = new SPOCK.Pair(t553, t554); - return k1187(t2170); - }; - var t2172 = t549.cdr; - return t548(t2169, t2172); - } - }; - t548 = t2161; // set! t548 - var t2174 = function (t1186) { - return t533(k1183, t1186); - }; - return t548(t2174, t534); - }; - return ___apply(t2160, t511, t535); - } - else { - return k1183(undefined); - } - }; - return t536(t2158, t534); - }; - t533 = t2141; // set! t533 - var t2180 = new SPOCK.Pair(t512, t513); - return t533(k1178, t2180); - } - }; - ___for_2deach = t2107; // set! for-each - var t2182 = function (k1191, t560, t561, t562) { // map - var r = SPOCK.count(arguments, "map"); - if(r) return r; - var t562 = SPOCK.rest(arguments, 3, 'map'); - var t2184 = null; - var t2183 = (t562) === (t2184); - var t1009 = t2183; - var t2185; - if(t1009 !== false) { - var t2186 = (t561) instanceof Array ; - var t1010 = t2186; - var t2187; - if(t1010 !== false) { - var t2189 = SPOCK.check(t561, Array, "map"); - var t2188 = t2189.length; - var t567 = t2188; - var t2190 = function (t1192) { - var t569 = t1192; - var t570 = undefined; - var t2191 = function (k1193, t571) { // t570 - var r = SPOCK.count(arguments, "t570"); - if(r) return r; - var t573 = t567; - var t2193 = SPOCK.check(t571, 'number', "t570"); - var t2194 = SPOCK.check(t573, 'number', "t570"); - var t2192 = (t2193) >= (t2194); - var t1011 = t2192; - var t2195; - if(t1011 !== false) { - return k1193(t569); - } - else { - var t574 = t569; - var t575 = t571; - var t2197 = function (t1195) { - var t576 = t1195; - var t2199 = SPOCK.check(t574, Array); - var t2200 = SPOCK.check(t575, 'number'); - var t2198 = (t2199) [ (t2200) ] = (t576); - var t1194 = t2198; - var t2202 = SPOCK.check(t571, 'number'); - var t2203 = SPOCK.check(1, 'number'); - var t2201 = (t2202) + (t2203); - return t570(k1193, t2201); - }; - var t577 = t561; - var t2206 = SPOCK.check(t577, Array, "t570"); - var t2207 = SPOCK.check(t571, 'number', "t570"); - var t2205 = (t2206) [ (t2207) ] ; - return t560(t2197, t2205); - } - }; - t570 = t2191; // set! t570 - return t570(k1191, 0); - }; - return ___make_2dvector(t2190, t567); - } - else { - var t581 = undefined; - var t2211 = function (k1196, t582) { // t581 - var r = SPOCK.count(arguments, "t581"); - if(r) return r; - var t2212 = (t582) instanceof SPOCK.Pair ; - var t1012 = t2212; - var t2213; - if(t1012 !== false) { - var t2214 = function (t1197) { - var t584 = t1197; - var t2215 = function (t1198) { - var t585 = t1198; - var t2216 = new SPOCK.Pair(t584, t585); - return k1196(t2216); - }; - var t2218 = t582.cdr; - return t581(t2215, t2218); - }; - var t2220 = t582.car; - return t560(t2214, t2220); - } - else { - var t2222 = null; - return k1196(t2222); - } - }; - t581 = t2211; // set! t581 - return t581(k1191, t561); - } - t2185 = t2187; - } - else { - var t588 = undefined; - var t2225 = function (k1199, t589) { // t588 - var r = SPOCK.count(arguments, "t588"); - if(r) return r; - var t591 = undefined; - var t2226 = function (k1206, t592) { // t591 - var r = SPOCK.count(arguments, "t591"); - if(r) return r; - var t2228 = null; - var t2227 = (t592) === (t2228); - var t1013 = t2227; - var t2229; - if(t1013 !== false) { - var t2230 = null; - return k1206(t2230); - } - else { - var t2232 = t592.car; - var t596 = t2232; - var t2233 = (t596) instanceof SPOCK.Pair ; - var t1014 = t2233; - var t2234; - if(t1014 !== false) { - var t2235 = t596.car; - var t599 = t2235; - var t2236 = function (t1207) { - var t600 = t1207; - var t2237 = new SPOCK.Pair(t599, t600); - return k1206(t2237); - }; - var t2239 = t592.cdr; - return t591(t2236, t2239); - } - else { - return k1206(false); - } - t2229 = t2234; - } - }; - t591 = t2226; // set! t591 - var t2242 = function (t1200) { - var t590 = t1200; - var t2243; - if(t590 !== false) { - var t2244 = function (t1201) { - var t603 = t1201; - var t605 = undefined; - var t2245 = function (k1204, t606) { // t605 - var r = SPOCK.count(arguments, "t605"); - if(r) return r; - var t2247 = null; - var t2246 = (t606) === (t2247); - var t1015 = t2246; - var t2248; - if(t1015 !== false) { - var t2249 = null; - return k1204(t2249); - } - else { - var t2251 = t606.car; - var t612 = t2251; - var t2252 = t612.cdr; - var t610 = t2252; - var t2253 = function (t1205) { - var t611 = t1205; - var t2254 = new SPOCK.Pair(t610, t611); - return k1204(t2254); - }; - var t2256 = t606.cdr; - return t605(t2253, t2256); - } - }; - t605 = t2245; // set! t605 - var t2258 = function (t1203) { - var t2259 = function (t1202) { - var t604 = t1202; - var t2260 = new SPOCK.Pair(t603, t604); - return k1199(t2260); - }; - return t588(t2259, t1203); - }; - return t605(t2258, t589); - }; - return ___apply(t2244, t560, t590); - } - else { - var t2265 = null; - return k1199(t2265); - } - }; - return t591(t2242, t589); - }; - t588 = t2225; // set! t588 - var t2268 = new SPOCK.Pair(t561, t562); - return t588(k1191, t2268); - } - }; - ___map = t2182; // set! map - var t2270 = function (k1208, t619, t620, t621) { - var r = SPOCK.count(arguments); - if(r) return r; - var t2271 = function (t1209) { - var t2272 = new SPOCK.Pair(t619, t621); - var t622 = t2272; - var t623 = SPOCK.dynwinds; - var t2273 = new SPOCK.Pair(t622, t623); - SPOCK.dynwinds = t2273 - var t2274 = function (k1210) { - var t626 = SPOCK.dynwinds; - var t2275 = t626.cdr; - SPOCK.dynwinds = t2275 - return t621(k1210); - }; - return ____25call_2dwith_2dsaved_2dvalues(k1208, t620, t2274); - }; - return t619(t2271); - }; - ___dynamic_2dwind = t2270; // set! dynamic-wind - var t2279 = function(K) { - SPOCK.count(arguments, '%call-with-current-continuation'); - var proc = arguments[ 1 ]; - function cont() { - return K.apply(SPOCK.global, Array.prototype.slice.call(arguments, 1));} - return proc(K, cont); - }; - ____25call_2dwith_2dcurrent_2dcontinuation = t2279; // set! %call-with-current-continuation - var t627 = undefined; - var t2280 = function (k1211, t628, t629) { // t627 - var r = SPOCK.count(arguments, "t627"); - if(r) return r; - var t631 = SPOCK.dynwinds; - var t2281 = (t631) === (t628); - var t630 = t2281; - var t2282; - if(t630 !== false) { - return k1211(t630); - } - else { - var t2285 = SPOCK.check(t629, 'number', "t627"); - var t2286 = SPOCK.check(0, 'number', "t627"); - var t2284 = (t2285) < (t2286); - var t1016 = t2284; - var t2287; - if(t1016 !== false) { - var t2288 = function (t1212) { - var t2289 = t628.car; - var t636 = t2289; - var t2290 = t636.car; - var t2291 = function (t1213) { - SPOCK.dynwinds = t628 - return k1211(undefined); - }; - return t2290(t2291); - }; - var t2294 = t628.cdr; - var t2295 = (t629) + 1 ; - return t627(t2288, t2294, t2295); - } - else { - var t640 = SPOCK.dynwinds; - var t2297 = t640.car; - var t639 = t2297; - var t2298 = t639.cdr; - var t638 = t2298; - var t641 = SPOCK.dynwinds; - var t2299 = t641.cdr; - SPOCK.dynwinds = t2299 - var t2300 = function (t1214) { - var t2301 = (t629) - 1 ; - return t627(k1211, t628, t2301); - }; - return t638(t2300); - } - t2282 = t2287; - } - }; - t627 = t2280; // set! t627 - var t2304 = function (k1215, t642) { - var r = SPOCK.count(arguments); - if(r) return r; - var t643 = SPOCK.dynwinds; - var t2305 = function (k1216, t644) { - var r = SPOCK.count(arguments); - if(r) return r; - var t2306 = function (k1217, t645) { - var t645 = SPOCK.rest(arguments, 1); - var t646 = SPOCK.dynwinds; - var t649 = t643; - var t2307 = (t646) === (t649); - var t647 = t2307; - var t2308; - if(t647 !== false) { - t2308 = false; - } - else { - t2308 = true; - } - var t1017 = t2308; - var t2309 = function (t1218) { // t1219 - return ___apply(k1217, t644, t645); - }; - var t1219 = t2309; - var t2311; - if(t1017 !== false) { - var t2312 = SPOCK.length(t646); - var t650 = t2312; - var t653 = t643; - var t2313 = SPOCK.length(t653); - var t651 = t2313; - var t2315 = SPOCK.check(t650, 'number'); - var t2316 = SPOCK.check(t651, 'number'); - var t2314 = (t2315) - (t2316); - return t627(t1219, t643, t2314); - } - else { - return t1219(undefined); - } - }; - return t642(k1216, t2306); - }; - return ____25call_2dwith_2dcurrent_2dcontinuation(k1215, t2305); - }; - ___call_2dwith_2dcurrent_2dcontinuation = t2304; // set! call-with-current-continuation - var t2321 = function (k1220, t654) { // %get-context - var r = SPOCK.count(arguments, "%get-context"); - if(r) return r; - return ___vector(k1220, t654, SPOCK.dynwinds, SPOCK.stdin, SPOCK.stdout, SPOCK.stderr); - }; - ____25get_2dcontext = t2321; // set! %get-context - var t2323 = function(K) { - SPOCK.count(arguments, '%restore-context'); - var state = arguments[ 1 ]; - SPOCK.dynwinds = state[ 1 ]; - SPOCK.stdin = state[ 2 ]; - SPOCK.stdout = state[ 3 ]; - SPOCK.stderr = state[ 4 ]; - return (state[ 0 ])(undefined); - }; - ____25restore_2dcontext = t2323; // set! %restore-context - var t2324 = function (k1221, t655) { // suspend - var r = SPOCK.count(arguments, "suspend"); - if(r) return r; - var t2325 = function (k1222, t656) { - var r = SPOCK.count(arguments); - if(r) return r; - var t2326 = function (t1224) { - var t2327 = function (t1223) { - var t2328 = function(K) { - SPOCK.count(arguments); - return new SPOCK.Result(undefined); - }; - return t2328(k1222); - }; - return t655(t2327, t1224); - }; - return ____25get_2dcontext(t2326, t656); - }; - return ____25call_2dwith_2dcurrent_2dcontinuation(k1221, t2325); - }; - ___suspend = t2324; // set! suspend - var t2333 = function (k1225, t657) { // %make-promise - var r = SPOCK.count(arguments, "%make-promise"); - if(r) return r; - var t658 = false; - var t659 = false; - var t2335 = function (k1226) { // t659 - var t2336; - if(t658 !== false) { - return ___apply(k1226, ___values, t659); - } - else { - var t2338 = function (k1227, t660) { - var t660 = SPOCK.rest(arguments, 1); - var t2339; - if(t658 !== false) { - return ___apply(k1227, ___values, t659); - } - else { - t658 = true; // set! t658 - t659 = t660; // set! t659 - return ___apply(k1227, ___values, t659); - } - }; - return ___call_2dwith_2dvalues(k1226, t657, t2338); - } - }; - var t2334 = new SPOCK.Promise(t2335); - return k1225(t2334); - }; - ____25make_2dpromise = t2333; // set! %make-promise - var t2344 = function (k1228, t661) { // force - var r = SPOCK.count(arguments, "force"); - if(r) return r; - var t2346 = (t661) instanceof SPOCK.Promise ; - var t2345; - if(t2346 !== false) { - var t2347 = t661.thunk; - return t2347(k1228); - } - else { - return k1228(t661); - } - }; - ___force = t2344; // set! force - var t662 = ___dynamic_2dwind; - var t2350 = function (k1229, t663, t664) { // t662 - var r = SPOCK.count(arguments, "t662"); - if(r) return r; - var t2351 = function (t1230) { - var t665 = false; - var t2352 = function (k1231) { - loop: while(true) { - t665 = SPOCK.stdin; // set! t665 - SPOCK.stdin = t663 - return k1231(undefined); - } - }; - var t2354 = function (k1232) { - loop: while(true) { - SPOCK.stdin = t665 - return k1232(undefined); - } - }; - return t662(k1229, t2352, t664, t2354); - }; - return ____25check_2dport(t2351, t663, "input", "with-input-from-port"); - }; - ___with_2dinput_2dfrom_2dport = t2350; // set! with-input-from-port - var t666 = ___dynamic_2dwind; - var t2358 = function (k1233, t667, t668) { // t666 - var r = SPOCK.count(arguments, "t666"); - if(r) return r; - var t2359 = function (t1234) { - var t669 = false; - var t2360 = function (k1235) { - loop: while(true) { - t669 = SPOCK.stdout; // set! t669 - SPOCK.stdout = t667 - return k1235(undefined); - } - }; - var t2362 = function (k1236) { - loop: while(true) { - SPOCK.stdout = t669 - return k1236(undefined); - } - }; - return t666(k1233, t2360, t668, t2362); - }; - return ____25check_2dport(t2359, t667, "output", "with-output-to-port"); - }; - ___with_2doutput_2dto_2dport = t2358; // set! with-output-to-port - var t2366 = function(K) { - SPOCK.count(arguments, '%close-port'); - var port = arguments[ 1 ]; - port.close(); - port.closed = true; - return K(port); - }; - ____25close_2dport = t2366; // set! %close-port - var t2367 = function(K) { - SPOCK.count(arguments, 'open-input-file'); - var fn = SPOCK.check(arguments[ 1 ], 'string', 'open-input-file'); - return K(SPOCK.openInputFile(fn)); - }; - ___open_2dinput_2dfile = t2367; // set! open-input-file - var t2368 = function(K) { - SPOCK.count(arguments, 'open-output-file'); - var fn = SPOCK.check(arguments[ 1 ], 'string', 'open-input-file'); - var exp = null; - if(arguments.length === 3) - exp = SPOCK.check(arguments[ 2 ], 'number', 'open-input-file'); - return K(SPOCK.openOutputFile(fn, exp)); - }; - ___open_2doutput_2dfile = t2368; // set! open-output-file - var t2369 = function (k1237, t670) { // close-input-port - var r = SPOCK.count(arguments, "close-input-port"); - if(r) return r; - var t2370 = function (t1238) { - var t671 = t1238; - return ____25close_2dport(k1237, t671); - }; - return ____25check_2dport(t2370, t670, "input", "close-input-port"); - }; - ___close_2dinput_2dport = t2369; // set! close-input-port - var t2373 = function (k1239, t672) { // close-output-port - var r = SPOCK.count(arguments, "close-output-port"); - if(r) return r; - var t2374 = function (t1240) { - var t673 = t1240; - return ____25close_2dport(k1239, t673); - }; - return ____25check_2dport(t2374, t672, "output", "close-output-port"); - }; - ___close_2doutput_2dport = t2373; // set! close-output-port - var t675 = ___open_2dinput_2dfile; - var t2377 = function (k1241, t678, t679) { - var r = SPOCK.count(arguments); - if(r) return r; - var t2378 = function (t1242) { - var t680 = t1242; - var t2379 = function (k1243) { - return t679(k1243, t680); - }; - var t2381 = function (k1244) { - return ___close_2dinput_2dport(k1244, t680); - }; - return ____25call_2dwith_2dsaved_2dvalues(k1241, t2379, t2381); - }; - return t675(t2378, t678); - }; - ___call_2dwith_2dinput_2dfile = t2377; // set! call-with-input-file - var t682 = ___open_2doutput_2dfile; - var t2385 = function (k1245, t685, t686) { - var r = SPOCK.count(arguments); - if(r) return r; - var t2386 = function (t1246) { - var t687 = t1246; - var t2387 = function (k1247) { - return t686(k1247, t687); - }; - var t2389 = function (k1248) { - return ___close_2doutput_2dport(k1248, t687); - }; - return ____25call_2dwith_2dsaved_2dvalues(k1245, t2387, t2389); - }; - return t682(t2386, t685); - }; - ___call_2dwith_2doutput_2dfile = t2385; // set! call-with-output-file - var t688 = ___with_2dinput_2dfrom_2dport; - var t689 = ___open_2dinput_2dfile; - var t693 = ___close_2dinput_2dport; - var t2393 = function (k1249, t694, t695) { // t693 - var r = SPOCK.count(arguments, "t693"); - if(r) return r; - var t2394 = function (t1250) { - var t696 = t1250; - var t2395 = function (k1251) { - var t2396 = function (k1252) { - return t693(k1252, t696); - }; - return ____25call_2dwith_2dsaved_2dvalues(k1251, t695, t2396); - }; - return t688(k1249, t696, t2395); - }; - return t689(t2394, t694); - }; - ___with_2dinput_2dfrom_2dfile = t2393; // set! with-input-from-file - var t697 = ___with_2doutput_2dto_2dport; - var t698 = ___open_2doutput_2dfile; - var t702 = ___close_2doutput_2dport; - var t2401 = function (k1253, t703, t704) { // t702 - var r = SPOCK.count(arguments, "t702"); - if(r) return r; - var t2402 = function (t1254) { - var t705 = t1254; - var t2403 = function (k1255) { - var t2404 = function (k1256) { - return t702(k1256, t705); - }; - return ____25call_2dwith_2dsaved_2dvalues(k1255, t704, t2404); - }; - return t697(k1253, t705, t2403); - }; - return t698(t2402, t703); - }; - ___with_2doutput_2dto_2dfile = t2401; // set! with-output-to-file - var t2409 = function (k1257, t706) { // open-input-string - var r = SPOCK.count(arguments, "open-input-string"); - if(r) return r; - var t707 = undefined; - var t2410 = function(K) { - SPOCK.count(arguments, 't707'); - var buffer = arguments[ 1 ]; - var pos = 0; - var len = buffer.length; - function read(n) { - if(pos >= len) return SPOCK.EOF; - var str = buffer.substring(pos, pos + n); - pos += n; - return str;} - return K(new SPOCK.Port('input', { read: read })); - }; - t707 = t2410; // set! t707 - var t2411 = SPOCK.jstring(t706); - return t707(k1257, t2411); - }; - ___open_2dinput_2dstring = t2409; // set! open-input-string - var t2413 = function(K) { - SPOCK.count(arguments, 'open-output-string'); - var buffer = []; - function write(s) { buffer.push(s); } - var port = new SPOCK.Port('output', { write: write }); - port.buffer = buffer; - port.isStringPort = true; - return K(port); - }; - ___open_2doutput_2dstring = t2413; // set! open-output-string - var t2414 = function (k1258, t709) { // get-output-string - var r = SPOCK.count(arguments, "get-output-string"); - if(r) return r; - loop: while(true) { - var t2415 = SPOCK.check(t709, SPOCK.Port, "get-output-string"); - var t710 = t2415; - var t2416 = t710.isStringPort; - var t712 = t2416; - var t2417 = t712 === undefined; - var t711 = t2417; - var t2418; - if(t711 !== false) { - t2418 = false; - } - else { - t2418 = true; - } - var t1018 = t2418; - var t2419; - if(t1018 !== false) { - var t2421 = t710.buffer; - var t2420 = t2421.join(""); - var t714 = t2420; - var t2422 = new SPOCK.String(t714); - var t713 = t2422; - var t2423 = (t710) .buffer = [] ; - t2419 = t713; - } - else { - var t2424 = SPOCK.error("bad argument type - not a string port", t710); - t2419 = t2424; - } - return k1258(t2419); - } - }; - ___get_2doutput_2dstring = t2414; // set! get-output-string - var t2426 = function (k1259, t715, t716) { // with-input-from-string - var r = SPOCK.count(arguments, "with-input-from-string"); - if(r) return r; - var t2427 = function (t1260) { - var t717 = t1260; - return ___with_2dinput_2dfrom_2dport(k1259, t717, t716); - }; - return ___open_2dinput_2dstring(t2427, t715); - }; - ___with_2dinput_2dfrom_2dstring = t2426; // set! with-input-from-string - var t2430 = function (k1261, t718) { // with-output-to-string - var r = SPOCK.count(arguments, "with-output-to-string"); - if(r) return r; - var t2431 = function (t1262) { - var t719 = t1262; - var t2432 = function (t1263) { - return ___get_2doutput_2dstring(k1261, t719); - }; - return ___with_2doutput_2dto_2dport(t2432, t719, t718); - }; - return ___open_2doutput_2dstring(t2431); - }; - ___with_2doutput_2dto_2dstring = t2430; // set! with-output-to-string - var t720 = ___read_2dchar; - var t721 = ___reverse; - var t722 = ___peek_2dchar; - var t723 = ___list_2d_3evector; - var t724 = ___list_2d_3estring; - var t2436 = function (k1264) { // t725 - loop: while(true) { - return k1264(SPOCK.stdin); - } - }; - var t725 = t2436; - var t726 = ___string_2d_3enumber; - var t2438 = function (k1265, t727) { // t726 - var r = SPOCK.count(arguments, "t726"); - if(r) return r; - var t2439 = t727 === undefined; - var t1019 = t2439; - var t2440 = function (t1266) { // t1323 - var t728 = t1266; - var t730 = undefined; - var t731 = undefined; - var t732 = undefined; - var t733 = undefined; - var t734 = undefined; - var t735 = undefined; - var t736 = undefined; - var t737 = undefined; - var t2441 = function (k1267, t738) { // t730 - var r = SPOCK.count(arguments, "t730"); - if(r) return r; - var t2442 = function (t1268) { - var t739 = t1268; - var t2443; - if(t739 !== false) { - return k1267(t739); - } - else { - return ___string_2d_3esymbol(k1267, t738); - } - }; - return t726(t2442, t738); - }; - t730 = t2441; // set! t730 - var t2447 = function (k1269) { // t731 - var t2448 = function (t1270) { - var t740 = t1270; - var t743 = SPOCK.EOF; - var t2449 = (t740) === (t743); - var t1020 = t2449; - var t2450; - if(t1020 !== false) { - return k1269(t740); - } - else { - var t744 = t740; - var t2454 = new SPOCK.Char("#"); - var t2453 = SPOCK.eqvp(t740, t2454); - var t1021 = t2453; - var t2455; - if(t1021 !== false) { - t2455 = true; - } - else { - t2455 = false; - } - var t2452; - if(t2455 !== false) { - return t734(k1269); - } - else { - var t2459 = new SPOCK.Char("("); - var t2458 = SPOCK.eqvp(t744, t2459); - var t1022 = t2458; - var t2460; - if(t1022 !== false) { - t2460 = true; - } - else { - t2460 = false; - } - var t2457; - if(t2460 !== false) { - var t2461 = new SPOCK.Char(")"); - return t735(k1269, t2461); - } - else { - var t2465 = new SPOCK.Char("["); - var t2464 = SPOCK.eqvp(t744, t2465); - var t1023 = t2464; - var t2466; - if(t1023 !== false) { - t2466 = true; - } - else { - t2466 = false; - } - var t2463; - if(t2466 !== false) { - var t2467 = new SPOCK.Char("]"); - return t735(k1269, t2467); - } - else { - var t2471 = new SPOCK.Char("{"); - var t2470 = SPOCK.eqvp(t744, t2471); - var t1024 = t2470; - var t2472; - if(t1024 !== false) { - t2472 = true; - } - else { - t2472 = false; - } - var t2469; - if(t2472 !== false) { - var t2473 = new SPOCK.Char("}"); - return t735(k1269, t2473); - } - else { - var t2477 = new SPOCK.Char(","); - var t2476 = SPOCK.eqvp(t744, t2477); - var t1025 = t2476; - var t2478; - if(t1025 !== false) { - t2478 = true; - } - else { - t2478 = false; - } - var t2475; - if(t2478 !== false) { - var t2479 = function (t1271) { - var t755 = t1271; - var t2481 = new SPOCK.Char("@"); - var t2480 = SPOCK.eqvp(t755, t2481); - var t1026 = t2480; - var t2482; - if(t1026 !== false) { - var t2483 = function (t1273) { - var t2484 = function (t1272) { - var t757 = t1272; - return k1269(t757); - }; - var t2486 = SPOCK.intern("unquote-splicing"); - return ____25list(t2484, t2486, t1273); - }; - return t731(t2483); - } - else { - var t2489 = function (t1275) { - var t2490 = function (t1274) { - var t758 = t1274; - return k1269(t758); - }; - var t2492 = SPOCK.intern("unquote"); - return ____25list(t2490, t2492, t1275); - }; - return t731(t2489); - } - }; - return t722(t2479, t728); - } - else { - var t2498 = new SPOCK.Char("`"); - var t2497 = SPOCK.eqvp(t744, t2498); - var t1027 = t2497; - var t2499; - if(t1027 !== false) { - t2499 = true; - } - else { - t2499 = false; - } - var t2496; - if(t2499 !== false) { - var t2500 = function (t1277) { - var t2501 = function (t1276) { - var t761 = t1276; - return k1269(t761); - }; - var t2503 = SPOCK.intern("quasiquote"); - return ____25list(t2501, t2503, t1277); - }; - return t731(t2500); - } - else { - var t2508 = new SPOCK.Char("'"); - var t2507 = SPOCK.eqvp(t744, t2508); - var t1028 = t2507; - var t2509; - if(t1028 !== false) { - t2509 = true; - } - else { - t2509 = false; - } - var t2506; - if(t2509 !== false) { - var t2510 = function (t1279) { - var t2511 = function (t1278) { - var t764 = t1278; - return k1269(t764); - }; - var t2513 = SPOCK.intern("quote"); - return ____25list(t2511, t2513, t1279); - }; - return t731(t2510); - } - else { - var t2518 = new SPOCK.Char(";"); - var t2517 = SPOCK.eqvp(t744, t2518); - var t1029 = t2517; - var t2519; - if(t1029 !== false) { - t2519 = true; - } - else { - t2519 = false; - } - var t2516; - if(t2519 !== false) { - var t2520 = function (t1280) { - return t731(k1269); - }; - return t732(t2520); - } - else { - var t2525 = new SPOCK.Char("\""); - var t2524 = SPOCK.eqvp(t744, t2525); - var t1030 = t2524; - var t2526; - if(t1030 !== false) { - t2526 = true; - } - else { - t2526 = false; - } - var t2523; - if(t2526 !== false) { - return t736(k1269); - } - else { - var t2530 = new SPOCK.Char(")"); - var t2529 = SPOCK.eqvp(t744, t2530); - var t1031 = t2529; - var t2531; - if(t1031 !== false) { - t2531 = true; - } - else { - var t2533 = new SPOCK.Char("]"); - var t2532 = SPOCK.eqvp(t744, t2533); - var t1032 = t2532; - var t2534; - if(t1032 !== false) { - t2534 = true; - } - else { - var t2536 = new SPOCK.Char("}"); - var t2535 = SPOCK.eqvp(t744, t2536); - var t1033 = t2535; - var t2537; - if(t1033 !== false) { - t2537 = true; - } - else { - t2537 = false; - } - t2534 = t2537; - } - t2531 = t2534; - } - var t2528; - if(t2531 !== false) { - return ____25error(k1269, "unexpected delimiter", t740); - } - else { - var t2540 = SPOCK.check(t740, SPOCK.Char); - var t2539 = (t2540) .character.match(/^\s$/) ; - var t777 = t2539; - var t2542 = null; - var t2541 = (t777) === (t2542); - var t776 = t2541; - var t2543; - if(t776 !== false) { - t2543 = false; - } - else { - t2543 = true; - } - var t1034 = t2543; - var t2544; - if(t1034 !== false) { - return t731(k1269); - } - else { - var t2546 = function (t1283) { - var t780 = t1283; - var t1282 = t780; - var t2547 = function (t1281) { - return t730(k1269, t1281); - }; - return t737(t2547, t1282); - }; - return ____25list(t2546, t740); - } - t2528 = t2544; - } - t2523 = t2528; - } - t2516 = t2523; - } - t2506 = t2516; - } - t2496 = t2506; - } - t2475 = t2496; - } - t2469 = t2475; - } - t2463 = t2469; - } - t2457 = t2463; - } - t2452 = t2457; - } - t2450 = t2452; - } - }; - return t720(t2448, t728); - }; - t731 = t2447; // set! t731 - var t2552 = function (k1284) { // t732 - var t2553 = function (t1285) { - var t781 = t1285; - var t786 = SPOCK.EOF; - var t2554 = (t781) === (t786); - var t783 = t2554; - var t2555; - if(t783 !== false) { - t2555 = t783; - } - else { - var t2558 = new SPOCK.Char("\n"); - var t2557 = SPOCK.check(t2558, SPOCK.Char); - var t2556 = t2557.character; - var t789 = t2556; - var t2560 = SPOCK.check(t781, SPOCK.Char); - var t2559 = t2560.character; - var t790 = t2559; - var t2561 = (t789) === (t790); - t2555 = t2561; - } - var t782 = t2555; - var t2562; - if(t782 !== false) { - t2562 = false; - } - else { - t2562 = true; - } - var t1035 = t2562; - var t2563; - if(t1035 !== false) { - return t732(k1284); - } - else { - return k1284(undefined); - } - }; - return t720(t2553, t728); - }; - t732 = t2552; // set! t732 - var t2567 = function (k1286) { // t733 - var t2568 = function (t1287) { - var t791 = t1287; - var t2570 = SPOCK.check(t791, SPOCK.Char); - var t2569 = (t2570) .character.match(/^\s$/) ; - var t794 = t2569; - var t2572 = null; - var t2571 = (t794) === (t2572); - var t793 = t2571; - var t2573; - if(t793 !== false) { - t2573 = false; - } - else { - t2573 = true; - } - var t1036 = t2573; - var t2574; - if(t1036 !== false) { - var t2575 = function (t1288) { - return t733(k1286); - }; - return t720(t2575, t728); - } - else { - return k1286(t791); - } - }; - return t722(t2568, t728); - }; - t733 = t2567; // set! t733 - var t2580 = function (k1289) { // t734 - var t2581 = function (t1290) { - var t797 = t1290; - var t800 = SPOCK.EOF; - var t2582 = (t797) === (t800); - var t1037 = t2582; - var t2583; - if(t1037 !== false) { - return ____25error(k1289, "unexpected EOF after `#'"); - } - else { - var t801 = t797; - var t2587 = new SPOCK.Char("t"); - var t2586 = SPOCK.eqvp(t797, t2587); - var t1038 = t2586; - var t2588; - if(t1038 !== false) { - t2588 = true; - } - else { - var t2590 = new SPOCK.Char("T"); - var t2589 = SPOCK.eqvp(t797, t2590); - var t1039 = t2589; - var t2591; - if(t1039 !== false) { - t2591 = true; - } - else { - t2591 = false; - } - t2588 = t2591; - } - var t2585; - if(t2588 !== false) { - return k1289(true); - } - else { - var t2595 = new SPOCK.Char("f"); - var t2594 = SPOCK.eqvp(t797, t2595); - var t1040 = t2594; - var t2596; - if(t1040 !== false) { - t2596 = true; - } - else { - var t2598 = new SPOCK.Char("F"); - var t2597 = SPOCK.eqvp(t797, t2598); - var t1041 = t2597; - var t2599; - if(t1041 !== false) { - t2599 = true; - } - else { - t2599 = false; - } - t2596 = t2599; - } - var t2593; - if(t2596 !== false) { - return k1289(false); - } - else { - var t2603 = new SPOCK.Char("("); - var t2602 = SPOCK.eqvp(t797, t2603); - var t1042 = t2602; - var t2604; - if(t1042 !== false) { - t2604 = true; - } - else { - t2604 = false; - } - var t2601; - if(t2604 !== false) { - var t2605 = function (t1291) { - return t723(k1289, t1291); - }; - var t2607 = new SPOCK.Char(")"); - return t735(t2605, t2607); - } - else { - var t2611 = new SPOCK.Char("%"); - var t2610 = SPOCK.eqvp(t801, t2611); - var t1043 = t2610; - var t2612; - if(t1043 !== false) { - t2612 = true; - } - else { - var t2614 = new SPOCK.Char("!"); - var t2613 = SPOCK.eqvp(t801, t2614); - var t1044 = t2613; - var t2615; - if(t1044 !== false) { - t2615 = true; - } - else { - t2615 = false; - } - t2612 = t2615; - } - var t2609; - if(t2612 !== false) { - var t2616 = function (t1294) { - var t816 = t1294; - var t1293 = t816; - var t2617 = function (t1292) { - return ___string_2d_3esymbol(k1289, t1292); - }; - return t737(t2617, t1293); - }; - var t2620 = new SPOCK.Char("#"); - return ____25list(t2616, t797, t2620); - } - else { - var t2624 = new SPOCK.Char("\\"); - var t2623 = SPOCK.eqvp(t801, t2624); - var t1045 = t2623; - var t2625; - if(t1045 !== false) { - t2625 = true; - } - else { - t2625 = false; - } - var t2622; - if(t2625 !== false) { - var t2626 = function (t1295) { - var t819 = t1295; - var t2628 = SPOCK.jstring("newline"); - var t2627 = t2628.toLowerCase(); - var t822 = t2627; - var t2630 = SPOCK.jstring(t819); - var t2629 = t2630.toLowerCase(); - var t823 = t2629; - var t2631 = (t822) === (t823); - var t1046 = t2631; - var t2632; - if(t1046 !== false) { - var t2633 = new SPOCK.Char("\n"); - return k1289(t2633); - } - else { - var t2636 = SPOCK.jstring("tab"); - var t2635 = t2636.toLowerCase(); - var t828 = t2635; - var t2638 = SPOCK.jstring(t819); - var t2637 = t2638.toLowerCase(); - var t829 = t2637; - var t2639 = (t828) === (t829); - var t1047 = t2639; - var t2640; - if(t1047 !== false) { - var t2641 = new SPOCK.Char("\t"); - return k1289(t2641); - } - else { - var t2644 = SPOCK.jstring("space"); - var t2643 = t2644.toLowerCase(); - var t834 = t2643; - var t2646 = SPOCK.jstring(t819); - var t2645 = t2646.toLowerCase(); - var t835 = t2645; - var t2647 = (t834) === (t835); - var t1048 = t2647; - var t2648; - if(t1048 !== false) { - var t2649 = new SPOCK.Char(" "); - return k1289(t2649); - } - else { - var t2652 = SPOCK.jstring(t819); - var t2651 = t2652.length; - var t838 = t2651; - var t2653 = SPOCK.check(t838, 'number'); - var t842 = t2653; - var t2654 = (0) === (t842); - var t1049 = t2654; - var t2655; - if(t1049 !== false) { - return ____25error(k1289, "invalid character syntax"); - } - else { - return ___string_2dref(k1289, t819, 0); - } - t2648 = t2655; - } - t2640 = t2648; - } - t2632 = t2640; - } - }; - var t2658 = null; - return t737(t2626, t2658); - } - else { - return ____25error(k1289, "invalid `#' syntax", t797); - } - t2609 = t2622; - } - t2601 = t2609; - } - t2593 = t2601; - } - t2585 = t2593; - } - t2583 = t2585; - } - }; - return t720(t2581, t728); - }; - t734 = t2580; // set! t734 - var t2662 = function (k1296, t843) { // t735 - var r = SPOCK.count(arguments, "t735"); - if(r) return r; - var t844 = undefined; - var t2663 = function (k1297, t845) { // t844 - var r = SPOCK.count(arguments, "t844"); - if(r) return r; - var t2664 = function (t1298) { - var t846 = t1298; - var t849 = SPOCK.EOF; - var t2665 = (t846) === (t849); - var t1050 = t2665; - var t2666; - if(t1050 !== false) { - return ____25error(k1297, "unexpected EOF while reading list"); - } - else { - var t851 = t843; - var t2669 = SPOCK.check(t846, SPOCK.Char); - var t2668 = t2669.character; - var t852 = t2668; - var t2671 = SPOCK.check(t851, SPOCK.Char); - var t2670 = t2671.character; - var t853 = t2670; - var t2672 = (t852) === (t853); - var t1051 = t2672; - var t2673; - if(t1051 !== false) { - var t2674 = function (t1299) { - return t721(k1297, t845); - }; - return t720(t2674, t728); - } - else { - var t2678 = new SPOCK.Char("."); - var t2677 = SPOCK.eqvp(t2678, t846); - var t1052 = t2677; - var t2679; - if(t1052 !== false) { - var t2680 = function (t1300) { - var t856 = t1300; - var t2681 = SPOCK.jstring("."); - var t859 = t2681; - var t2682 = SPOCK.jstring(t856); - var t860 = t2682; - var t2683 = (t859) === (t860); - var t1053 = t2683; - var t2684; - if(t1053 !== false) { - var t2685 = function (t1301) { - var t863 = t1301; - var t2686 = function (t1302) { - var t2687 = function (t1303) { - var t864 = t1303; - var t865 = t843; - var t2688 = SPOCK.eqvp(t864, t865); - var t1054 = t2688; - var t2689; - if(t1054 !== false) { - var t2690 = function (t1304) { - return ___append(k1297, t1304, t863); - }; - return t721(t2690, t845); - } - else { - return ____25error(k1297, "missing closing delimiter", t843); - } - }; - return t720(t2687, t728); - }; - return t733(t2686); - }; - return t731(t2685); - } - else { - var t2697 = function (t1306) { - var t866 = t1306; - var t2698 = new SPOCK.Pair(t866, undefined); - var t1305 = t2698; - return t844(k1297, t1305, t845); - }; - return t730(t2697, t856); - } - }; - var t2701 = null; - return t737(t2680, t2701); - } - else { - var t2703 = function (t1308) { - var t868 = t1308; - var t2704 = new SPOCK.Pair(t868, t845); - var t1307 = t2704; - return t844(k1297, t1307); - }; - return t731(t2703); - } - t2673 = t2679; - } - t2666 = t2673; - } - }; - return t733(t2664); - }; - t844 = t2663; // set! t844 - var t2708 = null; - return t844(k1296, t2708); - }; - t735 = t2662; // set! t735 - var t2710 = function (k1309) { // t736 - var t870 = undefined; - var t2711 = function (k1310, t871) { // t870 - var r = SPOCK.count(arguments, "t870"); - if(r) return r; - var t2712 = function (t1311) { - var t872 = t1311; - var t875 = SPOCK.EOF; - var t2713 = (t872) === (t875); - var t1055 = t2713; - var t2714; - if(t1055 !== false) { - return ____25error(k1310, "unexpected EOF while reading string"); - } - else { - var t2718 = new SPOCK.Char("\""); - var t2717 = SPOCK.check(t2718, SPOCK.Char); - var t2716 = t2717.character; - var t878 = t2716; - var t2720 = SPOCK.check(t872, SPOCK.Char); - var t2719 = t2720.character; - var t879 = t2719; - var t2721 = (t878) === (t879); - var t1056 = t2721; - var t2722; - if(t1056 !== false) { - var t2723 = function (t1312) { - return t724(k1310, t1312); - }; - return t721(t2723, t871); - } - else { - var t2728 = new SPOCK.Char("\\"); - var t2727 = SPOCK.check(t2728, SPOCK.Char); - var t2726 = t2727.character; - var t882 = t2726; - var t2730 = SPOCK.check(t872, SPOCK.Char); - var t2729 = t2730.character; - var t883 = t2729; - var t2731 = (t882) === (t883); - var t1057 = t2731; - var t2732; - if(t1057 !== false) { - var t2733 = function (t1313) { - var t884 = t1313; - var t887 = SPOCK.EOF; - var t2734 = (t884) === (t887); - var t1058 = t2734; - var t2735; - if(t1058 !== false) { - return ____25error(k1310, "unexpected EOF while reading string"); - } - else { - var t2739 = new SPOCK.Char("n"); - var t2738 = SPOCK.eqvp(t884, t2739); - var t1059 = t2738; - var t2740; - if(t1059 !== false) { - t2740 = true; - } - else { - t2740 = false; - } - var t2737; - if(t2740 !== false) { - var t2742 = new SPOCK.Char("\n"); - var t2741 = new SPOCK.Pair(t2742, t871); - return t870(k1310, t2741); - } - else { - var t2746 = new SPOCK.Char("t"); - var t2745 = SPOCK.eqvp(t884, t2746); - var t1060 = t2745; - var t2747; - if(t1060 !== false) { - t2747 = true; - } - else { - t2747 = false; - } - var t2744; - if(t2747 !== false) { - var t2749 = new SPOCK.Char("\t"); - var t2748 = new SPOCK.Pair(t2749, t871); - return t870(k1310, t2748); - } - else { - var t2751 = new SPOCK.Pair(t884, t871); - return t870(k1310, t2751); - } - t2737 = t2744; - } - t2735 = t2737; - } - }; - return t720(t2733, t728); - } - else { - var t2754 = new SPOCK.Pair(t872, t871); - return t870(k1310, t2754); - } - t2722 = t2732; - } - t2714 = t2722; - } - }; - return t720(t2712, t728); - }; - t870 = t2711; // set! t870 - var t2757 = null; - return t870(k1309, t2757); - }; - t736 = t2710; // set! t736 - var t2759 = function (k1314, t901) { // t737 - var r = SPOCK.count(arguments, "t737"); - if(r) return r; - var t902 = undefined; - var t2760 = function (k1315, t903) { // t902 - var r = SPOCK.count(arguments, "t902"); - if(r) return r; - var t2761 = function (t1316) { - var t904 = t1316; - var t908 = SPOCK.EOF; - var t2762 = (t904) === (t908); - var t905 = t2762; - var t2763 = function (t1317) { // t1321 - var t1061 = t1317; - var t2764; - if(t1061 !== false) { - var t2765 = function (t1318) { - return t724(k1315, t1318); - }; - return t721(t2765, t903); - } - else { - var t2768 = function (t1320) { - var t915 = t1320; - var t2769 = new SPOCK.Pair(t915, t903); - var t1319 = t2769; - return t902(k1315, t1319); - }; - return t720(t2768, t728); - } - }; - var t1321 = t2763; - var t2772; - if(t905 !== false) { - return t1321(t905); - } - else { - var t2774 = function (t1322) { - var t909 = t1322; - var t2775; - if(t909 !== false) { - t2775 = t909; - } - else { - var t2777 = SPOCK.check(t904, SPOCK.Char); - var t2776 = (t2777) .character.match(/^\s$/) ; - var t912 = t2776; - var t2779 = null; - var t2778 = (t912) === (t2779); - var t911 = t2778; - var t2780; - if(t911 !== false) { - t2780 = false; - } - else { - t2780 = true; - } - t2775 = t2780; - } - return t1321(t2775); - }; - var t2782 = new SPOCK.Pair(new SPOCK.Char("{"), new SPOCK.Pair(new SPOCK.Char("}"), new SPOCK.Pair(new SPOCK.Char("("), new SPOCK.Pair(new SPOCK.Char(")"), new SPOCK.Pair(new SPOCK.Char("["), new SPOCK.Pair(new SPOCK.Char("]"), new SPOCK.Pair(new SPOCK.Char(";"), new SPOCK.Pair(new SPOCK.Char("\""), null)))))))); - return ___memv(t2774, t904, t2782); - } - }; - return t722(t2761, t728); - }; - t902 = t2760; // set! t902 - return t902(k1314, t901); - }; - t737 = t2759; // set! t737 - return t731(k1265); - }; - var t1323 = t2440; - var t2787; - if(t1019 !== false) { - return t725(t1323); - } - else { - return t1323(t727); - } - }; - ___read = t2438; // set! read - var t2790 = function (k1324, t917, t918) { // load - var r = SPOCK.count(arguments, "load"); - if(r) return r; - loop: while(true) { - var t2792 = SPOCK.jstring(t917); - var t2793 = t918 === undefined; - var t920 = t2793; - var t2794; - if(t920 !== false) { - t2794 = false; - } - else { - t2794 = true; - } - var t1062 = t2794; - var t2795; - if(t1062 !== false) { - var t2796 = SPOCK.callback(t918); - t2795 = t2796; - } - else { - t2795 = false; - } - var t2791 = SPOCK.load(t2792, t2795); - return k1324(t2791); - } - }; - ___load = t2790; // set! load - var t2798 = function(K) { - SPOCK.count(arguments, '%error'); - SPOCK.error.apply(SPOCK.global, Array.prototype.slice.call(arguments, 1)); - }; - ____25error = t2798; // set! %error - ___error = ____25error; // set! error - var t2799 = function (k1325, t922) { // exit - var r = SPOCK.count(arguments, "exit"); - if(r) return r; - loop: while(true) { - var t2801 = t922 === undefined; - var t1063 = t2801; - var t2802; - if(t1063 !== false) { - t2802 = 0; - } - else { - var t2803 = SPOCK.check(t922, 'number', "exit"); - t2802 = t2803; - } - var t2800 = SPOCK.exit(t2802); - return k1325(t2800); - } - }; - ___exit = t2799; // set! exit - var t2805 = function (k1326, t924) { // milliseconds - var r = SPOCK.count(arguments, "milliseconds"); - if(r) return r; - var t2806 = (new Date()).getTime(); - var t925 = t2806; - var t2807 = t924 === undefined; - var t1064 = t2807; - var t2808; - if(t1064 !== false) { - return k1326(t925); - } - else { - var t2810 = function (t1327) { - var t2811 = (new Date()).getTime(); - var t928 = t2811; - var t2812 = (t928) - (t925); - return k1326(t2812); - }; - return t924(t2810); - } - }; - ___milliseconds = t2805; // set! milliseconds - var t2815 = function (k1328, t929) { // print - var t929 = SPOCK.rest(arguments, 1, 'print'); - var t2816 = function (t1329) { - return ___newline(k1328); - }; - return ___for_2deach(t2816, ___display, t929); - }; - ___print = t2815; // set! print - var t2819 = function (k1330, t930) { // o - var t930 = SPOCK.rest(arguments, 1, 'o'); - var t2821 = null; - var t2820 = (t930) === (t2821); - var t1065 = t2820; - var t2822; - if(t1065 !== false) { - var t2823 = function (k1331, t934) { - var r = SPOCK.count(arguments); - if(r) return r; - loop: while(true) { - return k1331(t934); - } - }; - return k1330(t2823); - } - else { - var t935 = undefined; - var t2826 = function (k1332, t936) { // t935 - var r = SPOCK.count(arguments, "t935"); - if(r) return r; - var t2827 = t936.car; - var t937 = t2827; - var t2828 = t936.cdr; - var t938 = t2828; - var t2830 = null; - var t2829 = (t938) === (t2830); - var t1066 = t2829; - var t2831; - if(t1066 !== false) { - t2831 = t937; - } - else { - var t2832 = function (k1333, t944) { - var r = SPOCK.count(arguments); - if(r) return r; - var t2833 = function (t1335) { - var t2834 = function (t1334) { - return t937(k1333, t1334); - }; - return t1335(t2834, t944); - }; - return t935(t2833, t938); - }; - t2831 = t2832; - } - return k1332(t2831); - }; - t935 = t2826; // set! t935 - return t935(k1330, t930); - } - }; - ___o = t2819; // set! o - var t2840 = function(K) { - SPOCK.count(arguments, '%'); - var o = {}; - for(var i = 1; i < arguments.length; i += 2) { - var x = arguments[ i ]; - if(typeof x === 'string') o[ x ] = arguments[ i + 1 ]; - else if(x instanceof SPOCK.String) - o[ x.name ] = arguments[ i + 1 ]; - else SPOCK.error('(%) object key not a string or symbol', x);} - return K(o); - }; - ____25 = t2840; // set! % - var t2841 = function(K) { - SPOCK.count(arguments, 'native'); - var func = arguments[ 1 ]; - return K(function(k) { - var args = Array.prototype.splice.call(arguments, 1); - return k(func.apply(SPOCK.global, args));}); - }; - ___native = t2841; // set! native - var t2842 = function(K) { - SPOCK.count(arguments, 'native-method'); - var func = arguments[ 1 ]; - return K(function(k) { - var args = Array.prototype.splice.call(arguments, 2); - return k(func.apply(arguments[ 1 ], args));}); - }; - ___native_2dmethod = t2842; // set! native-method - var t2843 = function(K) { - SPOCK.count(arguments, 'bind-method'); - var func = arguments[ 1 ]; - var that = arguments[ 2 ]; - return K(function() { return func.apply(that, arguments); }); - }; - ___bind_2dmethod = t2843; // set! bind-method - var t2844 = function(K) { - SPOCK.count(arguments, 'jstring'); - var x = arguments[ 1 ]; - if(typeof x === 'string') return K(x); - else if(x instanceof SPOCK.String) return K(x.normalize()); - else if(x instanceof SPOCK.Char) return K(x.character); - else return K(x); - }; - ___jstring = t2844; // set! jstring - return k1067(undefined); -}; -SPOCK.run(t1336); -SPOCK.flush(); -/* END OF GENERATED CODE */ diff --git a/spock-runtime-min.js b/spock-runtime-min.js @@ -1,439 +0,0 @@ - -var SPOCK={STACKSIZE:100,THREADSLICE:10,TRACELENGTH:32};SPOCK.modules={};SPOCK.symbolTable={};SPOCK.stack=0;SPOCK.limit=SPOCK.STACKSIZE;SPOCK.debug=false;SPOCK.running=false;SPOCK.runHook=[];SPOCK.inBrowser="document"in this;SPOCK.global=this;SPOCK.Continuation=function(func,args){this.k_callee=func;this.k_arguments=args;};SPOCK.Result=function(val){this.value=val;};SPOCK.Symbol=function(name){this.name=name;this.plist={};};SPOCK.Pair=function(car,cdr){this.car=car;this.cdr=cdr;};SPOCK.String=function(chars){if(typeof chars==="string"){this.parts=[chars];this.length=chars.length;} -else if(typeof chars==="number")this.parts=[chars.toString()];else this.parts=chars;};SPOCK.Char=function(str){this.character=str.charAt(0);};SPOCK.Port=function(direction,methods){var port=this;var read=methods.read||function(){SPOCK.error("reading from non-input port",port);};function doread(n){if(n===0)return"";else if(this.peeked){var p=this.peeked;this.peeked=false;if(n===1)return p;else return p+read(n-1);} -else return read(n);} -this.peeked=false;this.direction=direction;this.read=doread;this.write=methods.write||function(){SPOCK.error("writing to non-output port",port)};this.close=methods.close||function(){};this.flush=methods.flush||function(){};this.ready=methods.ready||function(){return true;};this.closed=false;};SPOCK.Promise=function(thunk){this.thunk=thunk;};SPOCK.EndOfFile=function(){};SPOCK.EOF=new SPOCK.EndOfFile();SPOCK.check=function(val,type,loc){if(typeof type==="function"&&val instanceof type)return val;if(typeof val===type)return val;else SPOCK.error((loc?"("+loc+") ":"")+"bad argument type"+ -(typeof type==="string"?" - expected `"+type+"'":""),val);};SPOCK.intern=function(str){var old=SPOCK.symbolTable[str];if(old)return old;else return SPOCK.symbolTable[str]=new SPOCK.Symbol(str);};SPOCK.stringify=function(x,readable){if(readable===undefined)readable=true;if(typeof x==="function")return"#<procedure>";else if(x===undefined)return"#<undefined>";else if(x===null)return"()";else if(x instanceof SPOCK.Continuation)return"#<continuation>";else if(x instanceof SPOCK.Symbol)return x.name;else if(x instanceof SPOCK.Pair){var str="(";var f=false;for(var p=x;p!==null&&p instanceof SPOCK.Pair;p=p.cdr){if(f)str+=" ";str+=SPOCK.stringify(p.car,readable);f=true;} -if(p!==null)str+=" . "+SPOCK.stringify(p,readable);return str+")";} -else if(x instanceof Array){var str="#(";var f=false;for(var i in x){if(f)str+=" ";str+=SPOCK.stringify(x[i],readable);f=true;} -return str+")";} -else if(x instanceof SPOCK.String){if(readable) -return"\""+x.normalize()+"\"";else return x.normalize();} -else if(x instanceof SPOCK.Char){if(readable)return x.character;switch(x.character){case"\n":return"#\\newline";case"\t":return"#\\tab";case"\r":return"#\\return";case" ":return"#\\space";default:return"#\\"+x.character;}} -else if(x instanceof SPOCK.Port) -return"#<"+x.direction+" port"+ -(x.name?(" \""+x.name+"\">"):">");else if(x instanceof SPOCK.Promise)return"#<promise>";else if(x instanceof SPOCK.EndOfFile)return"#<eof>";else return x.toString();};SPOCK.error=function(msg){var args=Array.prototype.splice.call(arguments,1);function argstr(x){return SPOCK.stringify(x,true);} -if(args.length>0) -msg=msg+":\n "+SPOCK.map(argstr,args).join("\n ");throw new Error(msg);};if(this.quit)SPOCK.exit=quit;else SPOCK.exit=function(code){SPOCK.error("no suitable primitive available for `exit'");};SPOCK.String.prototype.normalize=function(){if(this.parts.length===0)return"";this.parts=[this.parts.join("")];return this.parts[0];};SPOCK.jstring=function(x){if(typeof x==="string")return x;else if(x instanceof SPOCK.String)return x.normalize();else return x;};SPOCK.list=function(){var lst=null;var len=arguments.length;for(var i=len-1;i>=0;--i) -lst=new SPOCK.Pair(arguments[i],lst);return lst;};SPOCK.length=function(lst){for(var n=0;lst instanceof SPOCK.Pair;++n) -lst=lst.cdr;return n;};SPOCK.map=function(func,array){var len=array.length;var a2=new Array(len);for(var i in array) -a2[i]=func(array[i]);return a2;};SPOCK.eqvp=function(x,y){if(x===y)return true;else if(x instanceof SPOCK.Char) -return y instanceof SPOCK.Char&&x.character===y.character;else return false;};SPOCK.equalp=function(x,y){if(x===y)return true;else if(x instanceof SPOCK.Pair) -return y instanceof SPOCK.Pair&&SPOCK.equalp(x.car,y.car)&&SPOCK.equalp(x.cdr,y.cdr);else if(x instanceof Array){var len=x.length;if(!(y instanceof Array)||y.length!=len)return false;for(var i=0;i<len;++i){if(!SPOCK.equalp(x[i],y[i]))return false;} -return true;} -else if(x instanceof SPOCK.Char) -return y instanceof SPOCK.Char&&x.characters===y.characters;else if(x instanceof SPOCK.String){var s1=x.normalize();if(y instanceof SPOCK.String)return s1===y.normalize();else if(typeof y==='string')return s1===y;else return false;} -else if(typeof x==='string'){if(y instanceof SPOCK.String)return x===y.normalize();else if(typeof y==='string')return x===y;else return false;} -else return false;};SPOCK.count=function(args,loc){if(--SPOCK.stack<=0) -return new SPOCK.Continuation(args.callee,Array.prototype.slice.call(args));else return false;};SPOCK.rest=function(args,count,loc){var rest=null;SPOCK.count(args,loc);for(var i=args.length-1;i>=count;--i) -rest=new SPOCK.Pair(args[i],rest);return rest;};SPOCK.statistics=function(){};SPOCK.run=function(func){function terminate(result){return new SPOCK.Result(result);} -var k=terminate;var args=[k].concat(Array.prototype.slice.call(arguments,1));var oldstack=SPOCK.stack;var oldlimit=SPOCK.limit;var oldrunning=SPOCK.running;SPOCK.limit=Math.max(10,oldlimit-oldstack);SPOCK.stack=SPOCK.limit;SPOCK.running=true;function restore(){SPOCK.stack=oldstack;SPOCK.limit=oldlimit;SPOCK.running=oldrunning;if(!oldrunning){for(var i in SPOCK.runHook) -(SPOCK.runHook[i])(false);}} -var result;if(!oldrunning){for(var i in SPOCK.runHook) -(SPOCK.runHook[i])(true);} -while(true){result=func.apply(SPOCK.global,args);if(result instanceof SPOCK.Continuation){SPOCK.stack=SPOCK.STACKSIZE;func=result.k_callee;args=result.k_arguments;} -else if(result instanceof SPOCK.Result){restore();return result.value;} -else{restore();SPOCK.error("unexpected return of non-continuation",result);}} -return result;};SPOCK.callback=function(proc){return function(){var args=Array.prototype.slice.call(arguments);args.unshift(proc);return SPOCK.run.apply(this,args);};};SPOCK.callbackMethod=function(proc){var g=this;return function(){var args=Array.prototype.slice.call(arguments);args.unshift(this);args.unshift(proc);return SPOCK.run.apply(g,args);};};SPOCK.go=function(proc){(SPOCK.callback(proc))();};if("java"in this){SPOCK.makeJavaInputPort=function(jp){return new SPOCK.Port("input",{read:function(n){var buffer="";while(n--){var b=jp.read();if(b===-1)break;else buffer+=String.fromCharCode(b);} -return buffer===""?SPOCK.EOF:buffer;},close:function(){jp.close();}});};SPOCK.makeJavaOutputPort=function(jp){return new SPOCK.Port("output",{write:function(s){var len=s.length;for(var i=0;i<len;++i) -jp.write(s.charCodeAt(i));},flush:function(){jp.flush();},close:function(){jp.close();}});};SPOCK.log=function(){java.lang.System.err.println(Array.prototype.slice.call(arguments).join(""));};SPOCK.stdin=SPOCK.makeJavaInputPort(java.lang.System["in"]);SPOCK.stdout=SPOCK.makeJavaOutputPort(java.lang.System.out);SPOCK.stderr=SPOCK.makeJavaOutputPort(java.lang.System.err);SPOCK.stderr.name="[stderr]";} -else{if("console"in this)SPOCK.log=console.log;else if(SPOCK.inBrowser) -SPOCK.log=function(){var msg=arguments.join(" ");if(msg.charAt(msg.length-1)=="\n") -msg=msg.substring(0,msg.length-1);this.defaultStatus=msg;};else if("print"in this)SPOCK.log=print;else if(typeof process!==undefined)SPOCK.log=console.log;else SPOCK.error("no suitable output primitive available");(function(){var buffer=[];function flush(){if(buffer.length>0){SPOCK.log(buffer.join(""));buffer=[];}} -function write(s){var parts=SPOCK.stringify(s,false).split("\n");var len=parts.length-1;if(len>0){buffer.push(parts[0]);flush();if(len>1){for(var i=1;i<len;++i) -SPOCK.log(parts[i]);} -buffer.push(parts[len]);} -else buffer.push(parts[0]);} -SPOCK.stdout=new SPOCK.Port("output",{write:write,flush:flush});var inp;var ibuffer="";if(this.prompt){inp=function(n){while(true){if(ibuffer.length<=n){var part=ibuffer.slice(0,n);ibuffer=ibuffer.slice(n);return part;} -var input=prompt("Expecting input for "+this.toString());if(input===null)return SPOCK.EOF;else ibuffer+=input;}};} -else{inp=function(n){SPOCK.error("no input possible for standard input port");};} -SPOCK.stdin=new SPOCK.Port("input",{read:inp});SPOCK.stderr=SPOCK.stdout;})();} -SPOCK.stdin.name="[stdin]";SPOCK.stdout.name="[stdout]";SPOCK.flush=function(){SPOCK.stdout.flush();if(SPOCK.stderr!==SPOCK.stdout) -SPOCK.stderr.flush();SPOCK.statistics();};if(this.gc)SPOCK.gc=gc;else SPOCK.gc=function(){};SPOCK.openInputUrlHook=function(url){SPOCK.error("can not open",url);};SPOCK.openOutputUrlHook=function(url){SPOCK.error("can not open",url);};if("java"in this){SPOCK.openInputFile=function(filename){var stream;try{stream=new java.io.FileInputStream(filename);} -catch(e){SPOCK.error(e.message);} -var port=SPOCK.makeJavaInputPort(stream);port.name=filename;return port;};SPOCK.openOutputFile=function(filename){var stream;try{stream=new java.io.FileOutputStream(filename);} -catch(e){SPOCK.error(e.message);} -var port=SPOCK.makeJavaOutputPort(stream);port.name=filename;return port;};SPOCK.fileExists=function(filename){return(new java.io.File(filename)).exists();};} -else{if(SPOCK.inBrowser){SPOCK.openInputFile=function(filename){if(filename.match(/^[a-z0-9]+:/)) -return SPOCK.openInputUrlHook(filename);var cookies=document.cookie.split("; ");var buffer=null;for(var i=0;i<cookies.length;++i){var c=cookies[i];var p=c.indexOf("=");if(filename===c.substring(0,p)){buffer=c.substring(p+1);break;}} -if(!buffer)SPOCK.error("can not open file",filename);var pos=0;return new SPOCK.Port("input",{read:function(n){if(pos>=buffer.length)return SPOCK.EOF;else if(pos+len>=buffer.length) -return buffer.substring(pos);var p1=pos;pos+=n;return buffer.substring(p1,p1+n);},ready:function(){return pos<buffer.length;}});};SPOCK.openOutputFile=function(filename,expiry){if(filename.match(/^[a-z0-9]+:/)) -return SPOCK.openOutputUrlHook(filename);return new SPOCK.Port("output",{write:function(s){buffer+=s;},close:function(){var now=(new Date()).getTime();var exp=now+(expiry||(1000*60*60*24*365));document.cookie=filename+"="+encodeURIComponent(buffer)+"; expires="+(new Date(exp)).toGMTString();}});};} -else{SPOCK.openInputFile=function(filename){SPOCK.error("file-I/O not available");} -SPOCK.openOutputFile=function(filename){SPOCK.error("file-I/O not available");}} -SPOCK.fileExists=function(filename){SPOCK.error("`file-exists?' not available");};} -if("document"in this){SPOCK.load=function(url,k){var script=document.createElement("script") -script.type="text/javascript";k=k||function(){};if(script.readyState){script.onreadystatechange=function(){if(script.readyState=="loaded"||script.readyState=="complete"){script.onreadystatechange=null;k(url);}};} -else{script.onload=function(){k(url);};} -script.src=url;document.getElementsByTagName("head")[0].appendChild(script);};} -else if("load"in this){SPOCK.load=function(filename,k){load(filename);if(k)k(filename);};} -var t1350=function(k1097){var t1351=function(k1098,t1){var t1=SPOCK.rest(arguments,1);loop:while(true){return k1098(t1);}};____25list=t1351;var t1353=function(K){SPOCK.count(arguments,'values');return K.apply(SPOCK.global,Array.prototype.slice.call(arguments,1));};___values=t1353;var t1354=function(K){SPOCK.count(arguments,'call-with-values');var thunk=arguments[1];var proc=arguments[2];function k2(){var args=Array.prototype.slice.call(arguments);args.unshift(K);return proc.apply(SPOCK.global,args);} -return thunk(k2);};___call_2dwith_2dvalues=t1354;var t1355=function(K){SPOCK.count(arguments,'%call-with-saved-values');var t1=arguments[1];var t2=arguments[2];var args;function k2(){return K.apply(SPOCK.global,args);} -function k1(){args=Array.prototype.slice.call(arguments);return t2(k2);} -return t1(k1);};____25call_2dwith_2dsaved_2dvalues=t1355;var t1356=function(k1099,t2){var r=SPOCK.count(arguments);if(r)return r;var t3=undefined;var t1357=function(k1100,t4,t5){var r=SPOCK.count(arguments);if(r)return r;loop:while(true){var t1359=null;var t1358=(t4)===(t1359);var t6=t1358;var t1360;if(t6!==false){return k1100(t6);} -else{var t1362=(t4)instanceof SPOCK.Pair;var t975=t1362;var t1363;if(t975!==false){var t1364=t4.cdr;var t11=t1364;var t1366=null;var t1365=(t11)===(t1366);var t13=t1365;var t1367;if(t13!==false){return k1100(t13);} -else{var t1369=(t11)instanceof SPOCK.Pair;var t976=t1369;var t1370;if(t976!==false){var t1371=t11.cdr;var t18=t1371;var t1372=t5.cdr;var t19=t1372;var t1373=(t18)===(t19);var t22=t1373;var t1374;if(t22!==false){t1374=false;} -else{t1374=true;} -var t977=t1374;var t1375;if(t977!==false){var t1376=t18;var t1377=t19;t4=t1376;t5=t1377;continue loop;} -else{return k1100(false);} -t1370=t1375;} -else{return k1100(false);} -t1367=t1370;} -t1363=t1367;} -else{return k1100(false);} -t1360=t1363;}}};t3=t1357;return t3(k1099,t2,t2);};___list_3f=t1356;var t1382=function(k1101,t25){var r=SPOCK.count(arguments);if(r)return r;loop:while(true){var t1383=t25.car;var t27=t1383;var t1384=t27.car;var t26=t1384;var t1385=t26.car;return k1101(t1385);}};___caaar=t1382;var t1387=function(k1102,t32){var r=SPOCK.count(arguments);if(r)return r;loop:while(true){var t1388=t32.cdr;var t34=t1388;var t1389=t34.car;var t33=t1389;var t1390=t33.car;return k1102(t1390);}};___caadr=t1387;var t1392=function(k1103,t39){var r=SPOCK.count(arguments);if(r)return r;loop:while(true){var t1393=t39.car;var t41=t1393;var t1394=t41.cdr;var t40=t1394;var t1395=t40.car;return k1103(t1395);}};___cadar=t1392;var t1397=function(k1104,t46){var r=SPOCK.count(arguments);if(r)return r;loop:while(true){var t1398=t46.cdr;var t48=t1398;var t1399=t48.cdr;var t47=t1399;var t1400=t47.car;return k1104(t1400);}};___caddr=t1397;var t1402=function(k1105,t53){var r=SPOCK.count(arguments);if(r)return r;loop:while(true){var t1403=t53.car;var t55=t1403;var t1404=t55.car;var t54=t1404;var t1405=t54.cdr;return k1105(t1405);}};___cdaar=t1402;var t1407=function(k1106,t60){var r=SPOCK.count(arguments);if(r)return r;loop:while(true){var t1408=t60.cdr;var t62=t1408;var t1409=t62.car;var t61=t1409;var t1410=t61.cdr;return k1106(t1410);}};___cdadr=t1407;var t1412=function(k1107,t67){var r=SPOCK.count(arguments);if(r)return r;loop:while(true){var t1413=t67.car;var t69=t1413;var t1414=t69.cdr;var t68=t1414;var t1415=t68.cdr;return k1107(t1415);}};___cddar=t1412;var t1417=function(k1108,t74){var r=SPOCK.count(arguments);if(r)return r;loop:while(true){var t1418=t74.cdr;var t76=t1418;var t1419=t76.cdr;var t75=t1419;var t1420=t75.cdr;return k1108(t1420);}};___cdddr=t1417;var t1422=function(k1109,t81){var r=SPOCK.count(arguments);if(r)return r;loop:while(true){var t1423=t81.car;var t84=t1423;var t1424=t84.car;var t83=t1424;var t1425=t83.car;var t82=t1425;var t1426=t82.car;return k1109(t1426);}};___caaaar=t1422;var t1428=function(k1110,t90){var r=SPOCK.count(arguments);if(r)return r;loop:while(true){var t1429=t90.cdr;var t93=t1429;var t1430=t93.car;var t92=t1430;var t1431=t92.car;var t91=t1431;var t1432=t91.car;return k1110(t1432);}};___caaadr=t1428;var t1434=function(k1111,t99){var r=SPOCK.count(arguments);if(r)return r;loop:while(true){var t1435=t99.car;var t102=t1435;var t1436=t102.cdr;var t101=t1436;var t1437=t101.car;var t100=t1437;var t1438=t100.car;return k1111(t1438);}};___caadar=t1434;var t1440=function(k1112,t108){var r=SPOCK.count(arguments);if(r)return r;loop:while(true){var t1441=t108.cdr;var t111=t1441;var t1442=t111.cdr;var t110=t1442;var t1443=t110.car;var t109=t1443;var t1444=t109.car;return k1112(t1444);}};___caaddr=t1440;var t1446=function(k1113,t117){var r=SPOCK.count(arguments);if(r)return r;loop:while(true){var t1447=t117.car;var t120=t1447;var t1448=t120.car;var t119=t1448;var t1449=t119.cdr;var t118=t1449;var t1450=t118.car;return k1113(t1450);}};___cadaar=t1446;var t1452=function(k1114,t126){var r=SPOCK.count(arguments);if(r)return r;loop:while(true){var t1453=t126.cdr;var t129=t1453;var t1454=t129.car;var t128=t1454;var t1455=t128.cdr;var t127=t1455;var t1456=t127.car;return k1114(t1456);}};___cadadr=t1452;var t1458=function(k1115,t135){var r=SPOCK.count(arguments);if(r)return r;loop:while(true){var t1459=t135.car;var t138=t1459;var t1460=t138.cdr;var t137=t1460;var t1461=t137.cdr;var t136=t1461;var t1462=t136.car;return k1115(t1462);}};___caddar=t1458;var t1464=function(k1116,t144){var r=SPOCK.count(arguments);if(r)return r;loop:while(true){var t1465=t144.cdr;var t147=t1465;var t1466=t147.cdr;var t146=t1466;var t1467=t146.cdr;var t145=t1467;var t1468=t145.car;return k1116(t1468);}};___cadddr=t1464;var t1470=function(k1117,t153){var r=SPOCK.count(arguments);if(r)return r;loop:while(true){var t1471=t153.car;var t156=t1471;var t1472=t156.car;var t155=t1472;var t1473=t155.car;var t154=t1473;var t1474=t154.cdr;return k1117(t1474);}};___cdaaar=t1470;var t1476=function(k1118,t162){var r=SPOCK.count(arguments);if(r)return r;loop:while(true){var t1477=t162.cdr;var t165=t1477;var t1478=t165.car;var t164=t1478;var t1479=t164.car;var t163=t1479;var t1480=t163.cdr;return k1118(t1480);}};___cdaadr=t1476;var t1482=function(k1119,t171){var r=SPOCK.count(arguments);if(r)return r;loop:while(true){var t1483=t171.car;var t174=t1483;var t1484=t174.cdr;var t173=t1484;var t1485=t173.car;var t172=t1485;var t1486=t172.cdr;return k1119(t1486);}};___cdadar=t1482;var t1488=function(k1120,t180){var r=SPOCK.count(arguments);if(r)return r;loop:while(true){var t1489=t180.cdr;var t183=t1489;var t1490=t183.cdr;var t182=t1490;var t1491=t182.car;var t181=t1491;var t1492=t181.cdr;return k1120(t1492);}};___cdaddr=t1488;var t1494=function(k1121,t189){var r=SPOCK.count(arguments);if(r)return r;loop:while(true){var t1495=t189.car;var t192=t1495;var t1496=t192.car;var t191=t1496;var t1497=t191.cdr;var t190=t1497;var t1498=t190.cdr;return k1121(t1498);}};___cddaar=t1494;var t1500=function(k1122,t198){var r=SPOCK.count(arguments);if(r)return r;loop:while(true){var t1501=t198.cdr;var t201=t1501;var t1502=t201.car;var t200=t1502;var t1503=t200.cdr;var t199=t1503;var t1504=t199.cdr;return k1122(t1504);}};___cddadr=t1500;var t1506=function(k1123,t207){var r=SPOCK.count(arguments);if(r)return r;loop:while(true){var t1507=t207.car;var t210=t1507;var t1508=t210.cdr;var t209=t1508;var t1509=t209.cdr;var t208=t1509;var t1510=t208.cdr;return k1123(t1510);}};___cdddar=t1506;var t1512=function(k1124,t216){var r=SPOCK.count(arguments);if(r)return r;loop:while(true){var t1513=t216.cdr;var t219=t1513;var t1514=t219.cdr;var t218=t1514;var t1515=t218.cdr;var t217=t1515;var t1516=t217.cdr;return k1124(t1516);}};___cddddr=t1512;var t1518=function(k1125,t225){var t225=SPOCK.rest(arguments,1);var t1520=null;var t1519=(t225)===(t1520);var t978=t1519;var t1521;if(t978!==false){var t1522=null;return k1125(t1522);} -else{var t229=undefined;var t1524=function(k1126,t230){var r=SPOCK.count(arguments);if(r)return r;var t1525=t230.cdr;var t231=t1525;var t1527=null;var t1526=(t231)===(t1527);var t979=t1526;var t1528;if(t979!==false){var t1529=t230.car;return k1126(t1529);} -else{var t236=undefined;var t1531=function(k1127,t237){var r=SPOCK.count(arguments);if(r)return r;var t1532=(t237)instanceof SPOCK.Pair;var t980=t1532;var t1533;if(t980!==false){var t1534=t237.car;var t239=t1534;var t1535=function(t1128){var t240=t1128;var t1536=new SPOCK.Pair(t239,t240);return k1127(t1536);};var t1538=t237.cdr;return t236(t1535,t1538);} -else{var t243=t230;var t1540=t243.cdr;return t229(k1127,t1540);}};t236=t1531;var t1542=t230.car;return t236(k1126,t1542);}};t229=t1524;return t229(k1125,t225);}};___append=t1518;var t1545=function(k1129,t245){var r=SPOCK.count(arguments);if(r)return r;var t246=undefined;var t1546=function(k1130,t247,t248){var r=SPOCK.count(arguments);if(r)return r;loop:while(true){var t1547=(t247)instanceof SPOCK.Pair;var t981=t1547;var t1548;if(t981!==false){var t1551=t247.cdr;var t1549=t1551;var t1552=t247.car;var t251=t1552;var t1553=new SPOCK.Pair(t251,t248);var t1550=t1553;t247=t1549;t248=t1550;continue loop;} -else{return k1130(t248);}}};t246=t1546;var t1555=null;return t246(k1129,t245,t1555);};___reverse=t1545;var t1557=function(k1131,t254,t255){var r=SPOCK.count(arguments);if(r)return r;var t256=undefined;var t1558=function(k1132,t257,t258){var r=SPOCK.count(arguments);if(r)return r;loop:while(true){var t1560=(t257)<=0;var t1559;if(t1560!==false){return k1132(t258);} -else{var t1564=(t257)-1;var t1562=t1564;var t1565=t258.cdr;var t1563=t1565;t257=t1562;t258=t1563;continue loop;}}};t256=t1558;return t256(k1131,t255,t254);};___list_2dtail=t1557;var t260=___list_2dtail;var t1567=function(k1133,t261,t262){var r=SPOCK.count(arguments);if(r)return r;var t1568=function(t1134){var t263=t1134;var t1569=t263.car;return k1133(t1569);};return t260(t1568,t261,t262);};___list_2dref=t1567;var t1572=function(K){SPOCK.count(arguments,'memq');var x=arguments[1];for(var n=arguments[2];n instanceof SPOCK.Pair;n=n.cdr){if(n.car===x)return K(n);} -return K(false);};___memq=t1572;var t1573=function(K){SPOCK.count(arguments,'memv');var x=arguments[1];for(var n=arguments[2];n instanceof SPOCK.Pair;n=n.cdr){if(SPOCK.eqvp(n.car,x))return K(n);} -return K(false);};___memv=t1573;var t1574=function(K){SPOCK.count(arguments,'member');var x=arguments[1];for(var n=arguments[2];n instanceof SPOCK.Pair;n=n.cdr){if(SPOCK.equalp(n.car,x))return K(n);} -return K(false);};___member=t1574;var t1575=function(K){SPOCK.count(arguments,'assq');var x=arguments[1];for(var n=arguments[2];n instanceof SPOCK.Pair;n=n.cdr){var p=n.car;if(p instanceof SPOCK.Pair&&p.car===x)return K(p);} -return K(false);};___assq=t1575;var t1576=function(K){SPOCK.count(arguments,'assv');var x=arguments[1];for(var n=arguments[2];n instanceof SPOCK.Pair;n=n.cdr){var p=n.car;if(p instanceof SPOCK.Pair&&SPOCK.eqvp(p.car,x))return K(p);} -return K(false);};___assv=t1576;var t1577=function(K){SPOCK.count(arguments,'assoc');var x=arguments[1];for(var n=arguments[2];n instanceof SPOCK.Pair;n=n.cdr){var p=n.car;if(p instanceof SPOCK.Pair&&SPOCK.equalp(p.car,x))return K(p);} -return K(false);};___assoc=t1577;var t1578=function(K){SPOCK.count(arguments,'%+');var len=arguments.length;switch(len){case 1:return K(0);case 2:return K(arguments[1]);default:var p=arguments[1];for(var i=2;i<len;++i){p+=arguments[i];} -return K(p);}};____25_2b=t1578;var t1579=function(K){SPOCK.count(arguments,'%-');var len=arguments.length;switch(len){case 2:return K(-arguments[1]);default:var p=arguments[1];for(var i=2;i<len;++i){p-=arguments[i];} -return K(p);}};____25_2d=t1579;var t1580=function(K){SPOCK.count(arguments,'%*');var len=arguments.length;switch(len){case 1:return K(1);case 2:return K(arguments[1]);default:var p=arguments[1];for(var i=2;i<len;++i){p*=arguments[i];} -return K(p);}};____25_2a=t1580;var t1581=function(K){SPOCK.count(arguments,'%/');var len=arguments.length;switch(len){case 2:return K(1/arguments[1]);default:var p=arguments[1];for(var i=2;i<len;++i){p/=arguments[i];} -return K(p);}};____25_2f=t1581;var t1582=function(K){SPOCK.count(arguments,'%=');var argc=arguments.length;var last=SPOCK.check(arguments[1],'number','=');for(var i=2;i<argc;++i){var x=SPOCK.check(arguments[i],'number','=');if(last!==x)return K(false);else last=x;} -return K(true);};____25_3d=t1582;var t1583=function(K){SPOCK.count(arguments,'%>');var argc=arguments.length;var last=SPOCK.check(arguments[1],'number','>');for(var i=2;i<argc;++i){var x=SPOCK.check(arguments[i],'number','>');if(last<=x)return K(false);else last=x;} -return K(true);};____25_3e=t1583;var t1584=function(K){SPOCK.count(arguments,'%<');var argc=arguments.length;var last=SPOCK.check(arguments[1],'number','<');for(var i=2;i<argc;++i){var x=SPOCK.check(arguments[i],'number','<');if(last>=x)return K(false);else last=x;} -return K(true);};____25_3c=t1584;var t1585=function(K){SPOCK.count(arguments,'%>=');var argc=arguments.length;var last=SPOCK.check(arguments[1],'number','>=');for(var i=2;i<argc;++i){var x=SPOCK.check(arguments[i],'number','>=');if(last<x)return K(false);else last=x;} -return K(true);};____25_3e_3d=t1585;var t1586=function(K){SPOCK.count(arguments,'%<=');var argc=arguments.length;var last=SPOCK.check(arguments[1],'number','<=');for(var i=2;i<argc;++i){var x=SPOCK.check(arguments[i],'number','<=');if(last>x)return K(false);else last=x;} -return K(true);};____25_3c_3d=t1586;var t1587=function(K){SPOCK.count(arguments,'%max');return K(Math.max.apply(SPOCK.global,arguments));};____25max=t1587;var t1588=function(K){SPOCK.count(arguments,'%max');return K(Math.min.apply(SPOCK.global,arguments));};____25max=t1588;var t1589=function(k1135,t264,t265){var r=SPOCK.count(arguments);if(r)return r;loop:while(true){var t1590=(t264)/(t265);var t275=t1590;var t1592=(t275)<0;var t1591;if(t1592!==false){var t1593=Math.ceil(t275);t1591=t1593;} -else{var t1594=Math.floor(t275);t1591=t1594;} -var t271=t1591;var t1595=(t271)*(t265);var t270=t1595;var t1596=(t264)-(t270);var t266=t1596;var t1597=(t265)<(0);var t982=t1597;var t1598;if(t982!==false){var t1599=(t266)<=(0);var t983=t1599;var t1600;if(t983!==false){t1600=t266;} -else{var t1601=(t266)+(t265);t1600=t1601;} -t1598=t1600;} -else{var t1602=(t266)>=(0);var t984=t1602;var t1603;if(t984!==false){t1603=t266;} -else{var t1604=(t266)+(t265);t1603=t1604;} -t1598=t1603;} -return k1135(t1598);}};___modulo=t1589;var t1606=function(k1136,t289,t290){var r=SPOCK.count(arguments);if(r)return r;loop:while(true){var t1607=(t289)/(t290);var t297=t1607;var t1609=(t297)<0;var t1608;if(t1609!==false){var t1610=Math.ceil(t297);t1608=t1610;} -else{var t1611=Math.floor(t297);t1608=t1611;} -var t293=t1608;var t1612=(t293)*(t290);var t292=t1612;var t1613=(t289)-(t292);return k1136(t1613);}};var t288=t1606;var t1615=function(k1137,t300,t301){var r=SPOCK.count(arguments);if(r)return r;var t302=undefined;var t1616=function(k1138,t303,t304){var r=SPOCK.count(arguments);if(r)return r;var t1617=(0)===(t304);var t985=t1617;var t1618;if(t985!==false){var t1619=Math.abs(t303);return k1138(t1619);} -else{var t1621=function(t1139){return t302(k1138,t304,t1139);};return t288(t1621,t303,t304);}};t302=t1616;return t302(k1137,t300,t301);};____25gcd=t1615;var t1625=function(k1140,t309){var t309=SPOCK.rest(arguments,1);var t1627=null;var t1626=(t309)===(t1627);var t986=t1626;var t1628;if(t986!==false){return k1140(0);} -else{var t313=undefined;var t1630=function(k1141,t314,t315){var r=SPOCK.count(arguments);if(r)return r;var t1631=t314.car;var t316=t1631;var t1632=t314.cdr;var t317=t1632;var t1634=null;var t1633=(t317)===(t1634);var t987=t1633;var t1635;if(t987!==false){var t1636=Math.abs(t316);return k1141(t1636);} -else{var t1638=t317.car;var t324=t1638;var t1639=function(t1143){var t326=t1143;var t1640=t317.cdr;var t327=t1640;var t1641=new SPOCK.Pair(t326,t327);var t1142=t1641;return t313(k1141,t1142,false);};return ____25gcd(t1639,t316,t324);}};t313=t1630;return t313(k1140,t309,true);}};___gcd=t1625;var t1645=function(k1144,t329,t330){var r=SPOCK.count(arguments);if(r)return r;var t1646=(t329)*(t330);var t331=t1646;var t1647=function(t1145){var t332=t1145;var t1648=(t331)/(t332);var t335=t1648;var t1650=(t335)<0;var t1649;if(t1650!==false){var t1651=Math.ceil(t335);t1649=t1651;} -else{var t1652=Math.floor(t335);t1649=t1652;} -return k1144(t1649);};return ____25gcd(t1647,t329,t330);};____25lcm=t1645;var t1655=function(k1146,t338){var t338=SPOCK.rest(arguments,1);var t1657=null;var t1656=(t338)===(t1657);var t988=t1656;var t1658;if(t988!==false){return k1146(1);} -else{var t342=undefined;var t1660=function(k1147,t343,t344){var r=SPOCK.count(arguments);if(r)return r;var t1661=t343.car;var t345=t1661;var t1662=t343.cdr;var t346=t1662;var t1664=null;var t1663=(t346)===(t1664);var t989=t1663;var t1665;if(t989!==false){var t1666=Math.abs(t345);return k1147(t1666);} -else{var t1668=t346.car;var t353=t1668;var t1669=function(t1149){var t355=t1149;var t1670=t346.cdr;var t356=t1670;var t1671=new SPOCK.Pair(t355,t356);var t1148=t1671;return t342(k1147,t1148,false);};return ____25lcm(t1669,t345,t353);}};t342=t1660;return t342(k1146,t338,true);}};___lcm=t1655;var t1675=function(K){SPOCK.count(arguments,'string->symbol');var str=SPOCK.jstring(arguments[1]);return K(SPOCK.intern(str));};___string_2d_3esymbol=t1675;var t1676=function(k1150,t358,t359){var r=SPOCK.count(arguments);if(r)return r;loop:while(true){var t1678=t359.name;var t1677=(t358).plist[(t1678)];var t360=t1677;var t1679=t360===undefined;var t361=t1679;var t1680;if(t361!==false){t1680=false;} -else{t1680=true;} -var t990=t1680;var t1681;if(t990!==false){t1681=t360;} -else{t1681=false;} -return k1150(t1681);}};___get=t1676;var t1683=function(k1151,t363,t364,t365){var r=SPOCK.count(arguments);if(r)return r;loop:while(true){var t1685=t364.name;var t1684=(t363).plist[(t1685)]=(t365);return k1151(t1684);}};___put_21=t1683;var t1687=function(K){SPOCK.count(arguments,'string-append');var args=Array.prototype.slice.call(arguments,1);var strs=SPOCK.map(function(x){return SPOCK.jstring(x);},args);return K(new SPOCK.String(strs));};___string_2dappend=t1687;var t1688=function(K){SPOCK.count(arguments,'string');var str=[];var len=arguments.length-1;for(var i=1;i<=len;++i){var x=arguments[i];if(x instanceof SPOCK.Char)str.push(x.character);else SPOCK.error('bad argument type - not a character',x);} -return K(new SPOCK.String(str.join('')));};___string=t1688;var t1689=function(K){SPOCK.count(arguments,'string->list');var str=SPOCK.jstring(arguments[1]);var lst=null;var len=str.length;for(var i=len-1;i>=0;--i) -lst=new SPOCK.Pair(new SPOCK.Char(str.charAt(i)),lst);return K(lst);};___string_2d_3elist=t1689;var t1690=function(K){SPOCK.count(arguments,'list->string');var lst=arguments[1];var str=[];while(lst instanceof SPOCK.Pair){str.push(SPOCK.check(lst.car,SPOCK.Char).character);lst=lst.cdr;} -return K(new SPOCK.String(str.join('')));};___list_2d_3estring=t1690;var t1691=function(K){SPOCK.count(arguments,'make-string');var n=SPOCK.check(arguments[1],'number','make-string');var c=arguments[2];var a=new Array(n);if(c!==undefined) -c=SPOCK.check(c,SPOCK.Char,'make-string').character;else c=' ';for(var i=0;i<n;++i)a[i]=c;return K(new SPOCK.String(a.join('')));};___make_2dstring=t1691;var t1692=function(K){SPOCK.count(arguments,'string-ref');var str=arguments[1];var i=SPOCK.check(arguments[2],'number','string-ref');if(typeof str==='string') -return K(new SPOCK.Char(str.charAt(i)));else if(str instanceof SPOCK.String){var parts=str.parts;for(var p in parts){var l=parts[p].length;if(i<=l)return K(new SPOCK.Char(parts[p].charAt(i)));else i-=l;} -SPOCK.error('`string-ref\' out of range',str,i);}};___string_2dref=t1692;var t1693=function(K){SPOCK.count(arguments,'string-set!');var str=arguments[1];var i=SPOCK.check(arguments[2],'number','string-set!');var c=SPOCK.check(arguments[3],SPOCK.Char,'string-set!');if(typeof str==='string') -SPOCK.error('argument to `string-set!\' is not a mutable string',str);else if(str instanceof SPOCK.String){var parts=str.parts;for(var p in parts){var part=parts[p];var l=part.length;if(i<=l){parts[p]=part.substring(0,i)+c.character+part.substring(i+1);return K(undefined);}else i-=l;} -SPOCK.error('`string-set!\' out of range',str,i);}};___string_2dset_21=t1693;var t1694=function(k1152,t366,t367,t368){var r=SPOCK.count(arguments);if(r)return r;loop:while(true){var t1695=SPOCK.jstring(t366);var t369=t1695;var t1696=t367===undefined;var t991=t1696;var t1697;if(t991!==false){t1697=0;} -else{t1697=t367;} -var t371=t1697;var t1698=t368===undefined;var t992=t1698;var t1699;if(t992!==false){var t1700=t369.length;t1699=t1700;} -else{t1699=t368;} -var t373=t1699;var t1701=t369.slice(t371,t373);var t375=t1701;var t1702=new SPOCK.String(t375);return k1152(t1702);}};___string_2dcopy=t1694;var t1704=function(k1153,t376,t377,t378,t379){var r=SPOCK.count(arguments);if(r)return r;var t1705;if(true!==false){t1705=false;} -else{t1705=true;} -var t993=t1705;var t1706=function(t1154){var t1707=t376.normalize();var t381=t1707;var t382=t377;var t1708=t378===undefined;var t994=t1708;var t1709;if(t994!==false){t1709=0;} -else{t1709=t378;} -var t383=t1709;var t1710=t379===undefined;var t995=t1710;var t1711;if(t995!==false){var t1712=t381.length;t1711=t1712;} -else{t1711=t379;} -var t385=t1711;var t1713=function(K){SPOCK.count(arguments);var str=arguments[1];var from=arguments[2];var to=arguments[3];var c=arguments[4];var snew=new Array(to-from);for(var i in snew)snew[i]=c;str.parts=[str.parts[0].substring(0,from),snew.join(''),str.parts[0].substring(to)];return K(str);};return t1713(k1153,t376,t383,t385,t382);};var t1155=t1706;var t1715;if(t993!==false){return ____25error(t1155,"bad argument type - not a mutable string",t376);} -else{return t1155(undefined);}};___string_2dfill_21=t1704;var t1718=function(K){SPOCK.count(arguments,'vector');return K(Array.prototype.slice.call(arguments,1));};___vector=t1718;var t1719=function(K){SPOCK.count(arguments,'make-vector');var n=SPOCK.check(arguments[1],'number','make-vector');var x=arguments[2];var a=new Array(n);if(x!==undefined){for(var i=0;i<n;++i)a[i]=x;} -return K(a);};___make_2dvector=t1719;var t1720=function(K){SPOCK.count(arguments,'vector->list');var vec=SPOCK.check(arguments[1],Array,'vector->list');var lst=null;var len=vec.length;for(var i=len-1;i>=0;--i) -lst=new SPOCK.Pair(vec[i],lst);return K(lst);};___vector_2d_3elist=t1720;var t1721=function(K){SPOCK.count(arguments,'list->vector');var lst=arguments[1];var vec=[];while(lst instanceof SPOCK.Pair){vec.push(lst.car);lst=lst.cdr;} -return K(vec);};___list_2d_3evector=t1721;var t1722=function(K){SPOCK.count(arguments,'vector-fill!');var vec=SPOCK.check(arguments[1],Array,'vector-fill!');var x=arguments[2];var from=arguments[3];var to=arguments[4];if(from===undefined)from=0;if(to===undefined)to=vec.length;for(var i=from;i<to;++i) -vec[i]=x;return K(undefined);};___vector_2dfill_21=t1722;var t1723=function(K){SPOCK.count(arguments,'string->number');var str=SPOCK.jstring(arguments[1]);var base=arguments[2];if(!base)base=10;else base=SPOCK.check(base,'number','string->number');var m=true,neg=1;while(m){m=str.match(/^#[eboxid]/);if(m){switch(str[1]){case'e':case'i':break;case'd':base=10;break;case'o':base=8;break;case'x':base=16;break;case'b':base=2;break;default:return K(false);} -str=str.substring(2);}} -switch(str[0]){case'-':neg=-1;str=str.substring(1);break;case'+':str=str.substring(1);} -var num,den=false;if((m=str.match(/^([^\/]+)\/(.+)$/))){str=m[1];den=m[2];} -function num3(s){var tr=null;switch(base){case 2:tr=/^[0-1]+$/;break;case 8:tr=/^[0-7]+$/;break;case 10:tr=/^[#0-9]*\.?[#0-9]+([esdfl][-+]?[0-9]+)?$/;break;case 16:tr=/^[0-9a-fA-F]+$/;} -if(tr&&!s.match(tr))return false;var s2=s.replace(/#/g,'0');if(base===10)s2=parseFloat(s2.replace(/[esdfl]/g,'e'));else if(s2!==s)return false;else s2=parseInt(s2,base);return isNaN(s2)?false:s2;} -if((num=num3(str))===false)return K(false);if(den&&!(den=num3(den)))return K(false);return K(neg*num/(den||1));};___string_2d_3enumber=t1723;var t1724=function(K){SPOCK.count(arguments,'%show');arguments[2].write(arguments[1]);return K(undefined);};____25show=t1724;var t1725=function(K){SPOCK.count(arguments,'%fetch');return K(arguments[2].read(arguments[1]));};____25fetch=t1725;var t1726=function(k1156,t387){var r=SPOCK.count(arguments);if(r)return r;var t1727=t387===undefined;var t996=t1727;var t1728;if(t996!==false){t1728=SPOCK.stdout;} -else{t1728=t387;} -return ____25show(k1156,"\n",t1728);};___newline=t1726;var t1730=function(k1157,t392){var r=SPOCK.count(arguments);if(r)return r;var t1731=function(t1158){var t393=t1158;var t400=SPOCK.EOF;var t1732=(t393)===(t400);var t998=t1732;var t1733;if(t998!==false){t1733=t393;} -else{var t1734=new SPOCK.Char(t393);t1733=t1734;} -return k1157(t1733);};var t1736=t392===undefined;var t997=t1736;var t1737;if(t997!==false){t1737=SPOCK.stdin;} -else{t1737=t392;} -return ____25fetch(t1731,1,t1737);};___read_2dchar=t1730;var t1739=function(k1159,t401,t402){var r=SPOCK.count(arguments);if(r)return r;var t1740=t401.character;var t1741=t402===undefined;var t999=t1741;var t1742;if(t999!==false){t1742=SPOCK.stdout;} -else{t1742=t402;} -return ____25show(k1159,t1740,t1742);};___write_2dchar=t1739;var t407=___read_2dchar;var t1744=function(k1160,t408){var r=SPOCK.count(arguments);if(r)return r;var t1745=function(t1161){var t409=t1161;var t413=SPOCK.EOF;var t1746=(t409)===(t413);var t410=t1746;var t1747;if(t410!==false){t1747=false;} -else{t1747=true;} -var t1000=t1747;var t1748;if(t1000!==false){var t1750=t409.character;var t1749=(t408).peeked=(t1750);t1748=t1749;} -else{} -return k1160(t409);};return t407(t1745,t408);};___peek_2dchar=t1744;var t1753=function(k1162,t414){var r=SPOCK.count(arguments);if(r)return r;loop:while(true){var t1754=t414.ready();return k1162(t1754);}};___char_2dready_3f=t1753;var t1756=function(k1163,t418,t419,t420){var r=SPOCK.count(arguments);if(r)return r;return ____25show(k1163,"#<unknown object>",t419);};____25print_2dhook=t1756;var t1758=function(k1164,t421,t422){var r=SPOCK.count(arguments);if(r)return r;var t1759=t422===undefined;var t1001=t1759;var t1760;if(t1001!==false){t1760=SPOCK.stdout;} -else{t1760=t422;} -var t423=t1760;var t428=undefined;var t1761=function(k1165,t429){var r=SPOCK.count(arguments);if(r)return r;var t1763=null;var t1762=(t429)===(t1763);var t1002=t1762;var t1764;if(t1002!==false){return ____25show(k1165,"()",t423);} -else{var t1766=typeof(t429);var t434=t1766;var t1767=(t434)===("number");var t1003=t1767;var t1768;if(t1003!==false){var t1771=undefined===undefined;var t1004=t1771;var t1772;if(t1004!==false){t1772=10;} -else{} -var t1770=t429.toString(t1772);var t1769=new SPOCK.String(t1770);var t436=t1769;var t1773=SPOCK.jstring(t436);return ____25show(k1165,t1773,t423);} -else{var t1775=typeof(t429);var t442=t1775;var t1776=(t442)===("string");var t441=t1776;var t1777;if(t441!==false){t1777=t441;} -else{var t1778=(t429)instanceof SPOCK.String;t1777=t1778;} -var t1005=t1777;var t1779;if(t1005!==false){var t1780=SPOCK.jstring(t429);return ____25show(k1165,t1780,t423);} -else{var t1782=(t429)instanceof SPOCK.Symbol;var t1006=t1782;var t1783;if(t1006!==false){var t1784=t429.name;return ____25show(k1165,t1784,t423);} -else{var t1786=(t429)instanceof SPOCK.Char;var t1007=t1786;var t1787;if(t1007!==false){var t1788=t429.character;return ____25show(k1165,t1788,t423);} -else{var t448=SPOCK.EOF;var t1790=(t429)===(t448);var t1008=t1790;var t1791;if(t1008!==false){return ____25show(k1165,"#<eof>",t423);} -else{var t1793=typeof(t429);var t450=t1793;var t1794=(t450)===("function");var t1009=t1794;var t1795;if(t1009!==false){return ____25show(k1165,"#<procedure>",t423);} -else{var t1797=(t429)===(true);var t453=t1797;var t1798;if(t453!==false){t1798=t453;} -else{var t1799=(t429)===(false);t1798=t1799;} -var t1010=t1798;var t1800;if(t1010!==false){var t1801;if(t429!==false){t1801="#t";} -else{t1801="#f";} -return ____25show(k1165,t1801,t423);} -else{var t1803=(t429)instanceof SPOCK.Pair;var t1011=t1803;var t1804;if(t1011!==false){var t1805=function(t1166){var t459=undefined;var t1806=function(k1167,t460){var r=SPOCK.count(arguments);if(r)return r;var t1808=null;var t1807=(t460)===(t1808);var t1012=t1807;var t1809;if(t1012!==false){return ____25show(k1167,")",t423);} -else{var t1811=(t460)instanceof SPOCK.Pair;var t464=t1811;var t1812;if(t464!==false){t1812=false;} -else{t1812=true;} -var t1013=t1812;var t1813;if(t1013!==false){var t1814=function(t1168){var t1815=function(t1169){return ____25show(k1167,")",t423);};return t428(t1815,t460);};return ____25show(t1814," . ",t423);} -else{var t467=t429;var t1819=(t467)===(t460);var t466=t1819;var t1820;if(t466!==false){t1820=false;} -else{t1820=true;} -var t1014=t1820;var t1821=function(t1170){var t1822=function(t1171){var t1823=t460.cdr;return t459(k1167,t1823);};var t1825=t460.car;return t428(t1822,t1825);};var t1172=t1821;var t1827;if(t1014!==false){return ____25show(t1172," ",t423);} -else{return t1172(undefined);} -t1813=t1827;} -t1809=t1813;}};t459=t1806;return t459(k1165,t429);};return ____25show(t1805,"(",t423);} -else{var t1832=t429===undefined;var t1015=t1832;var t1833;if(t1015!==false){return ____25show(k1165,"#<undefined>",t423);} -else{var t1835=(t429)instanceof Array;var t1016=t1835;var t1836;if(t1016!==false){var t1837=t429.length;var t474=t1837;var t1838=function(t1173){var t475=undefined;var t1839=function(k1174,t476){var r=SPOCK.count(arguments);if(r)return r;var t1841=(t476)>=(t474);var t1840;if(t1841!==false){return ____25show(k1174,")",t423);} -else{var t1843=(t476)===(0);var t477=t1843;var t1844;if(t477!==false){t1844=false;} -else{t1844=true;} -var t1017=t1844;var t1845=function(t1175){var t1846=function(t1176){var t1847=1+(t476);return t475(k1174,t1847);};var t1849=(t429)[(t476)];return t428(t1846,t1849);};var t1177=t1845;var t1851;if(t1017!==false){return ____25show(t1177," ",t423);} -else{return t1177(undefined);} -t1840=t1851;}};t475=t1839;return t475(k1165,0);};return ____25show(t1838,"#(",t423);} -else{var t1857=(t429)instanceof SPOCK.Port;var t1856;if(t1857!==false){var t1858=SPOCK.stringify(t429);return ____25show(k1165,t1858,t423);} -else{var t1861=(t429)instanceof SPOCK.Promise;var t1860;if(t1861!==false){return ____25show(k1165,"#<promise>",t423);} -else{var t1863=typeof(t429);var t481=t1863;var t1864=("object")===(t481);var t1018=t1864;var t1865;if(t1018!==false){return ____25print_2dhook(k1165,t429,t423,false);} -else{return ____25show(k1165,"#<unknown object>",t423);} -t1860=t1865;} -t1856=t1860;} -t1836=t1856;} -t1833=t1836;} -t1804=t1833;} -t1800=t1804;} -t1795=t1800;} -t1791=t1795;} -t1787=t1791;} -t1783=t1787;} -t1779=t1783;} -t1768=t1779;} -t1764=t1768;}};t428=t1761;return t428(k1164,t421);};___display=t1758;var t482=___display;var t483=undefined;var t1869=function(K){SPOCK.count(arguments,'t483');var str=arguments[1];var a=[];var len=str.length;for(var i=0;i<len;++i){var c=str.charAt(i);switch(c){case'\n':a.push('\n');break;case'\t':a.push('\t');break;case'\r':a.push('\r');break;case'\"':a.push('\\"');break;case'\\':a.push('\\');break;default:a.push(c);}} -return K(a.join(''));};t483=t1869;var t1870=function(k1178,t484,t485){var r=SPOCK.count(arguments);if(r)return r;var t1871=t485===undefined;var t1019=t1871;var t1872;if(t1019!==false){t1872=SPOCK.stdout;} -else{t1872=t485;} -var t486=t1872;var t491=undefined;var t1873=function(k1179,t492){var r=SPOCK.count(arguments);if(r)return r;var t1874=typeof(t492);var t495=t1874;var t1875=(t495)===("string");var t494=t1875;var t1876;if(t494!==false){t1876=t494;} -else{var t1877=(t492)instanceof SPOCK.String;t1876=t1877;} -var t1020=t1876;var t1878;if(t1020!==false){var t1879=function(t1180){var t1880=function(t1182){var t1881=function(t1181){return ____25show(k1179,"\"",t486);};return ____25show(t1881,t1182,t486);};var t1884=SPOCK.jstring(t492);return t483(t1880,t1884);};return ____25show(t1879,"\"",t486);} -else{var t1887=(t492)instanceof SPOCK.Char;var t1021=t1887;var t1888;if(t1021!==false){var t1889=function(t1183){var t1890=t492.character;var t498=t1890;var t1892=SPOCK.eqvp(t498,"\n");var t1022=t1892;var t1893;if(t1022!==false){t1893=true;} -else{t1893=false;} -var t1891;if(t1893!==false){t1891="newline";} -else{var t1895=SPOCK.eqvp(t498,"\r");var t1023=t1895;var t1896;if(t1023!==false){t1896=true;} -else{t1896=false;} -var t1894;if(t1896!==false){t1894="return";} -else{var t1898=SPOCK.eqvp(t498,"\t");var t1024=t1898;var t1899;if(t1024!==false){t1899=true;} -else{t1899=false;} -var t1897;if(t1899!==false){t1897="tab";} -else{var t1901=SPOCK.eqvp(t498," ");var t1025=t1901;var t1902;if(t1025!==false){t1902=true;} -else{t1902=false;} -var t1900;if(t1902!==false){t1900="space";} -else{t1900=t498;} -t1897=t1900;} -t1894=t1897;} -t1891=t1894;} -return ____25show(k1179,t1891,t486);};return ____25show(t1889,"#\\",t486);} -else{var t1905=(t492)instanceof SPOCK.Pair;var t1026=t1905;var t1906;if(t1026!==false){var t1907=function(t1184){var t509=undefined;var t1908=function(k1185,t510){var r=SPOCK.count(arguments);if(r)return r;var t1910=null;var t1909=(t510)===(t1910);var t1027=t1909;var t1911;if(t1027!==false){return ____25show(k1185,")",t486);} -else{var t1913=(t510)instanceof SPOCK.Pair;var t514=t1913;var t1914;if(t514!==false){t1914=false;} -else{t1914=true;} -var t1028=t1914;var t1915;if(t1028!==false){var t1916=function(t1186){var t1917=function(t1187){return ____25show(k1185,")",t486);};return t491(t1917,t510);};return ____25show(t1916," . ",t486);} -else{var t517=t492;var t1921=(t517)===(t510);var t516=t1921;var t1922;if(t516!==false){t1922=false;} -else{t1922=true;} -var t1029=t1922;var t1923=function(t1188){var t1924=function(t1189){var t1925=t510.cdr;return t509(k1185,t1925);};var t1927=t510.car;return t491(t1924,t1927);};var t1190=t1923;var t1929;if(t1029!==false){return ____25show(t1190," ",t486);} -else{return t1190(undefined);} -t1915=t1929;} -t1911=t1915;}};t509=t1908;return t509(k1179,t492);};return ____25show(t1907,"(",t486);} -else{var t1934=(t492)instanceof Array;var t1030=t1934;var t1935;if(t1030!==false){var t1936=t492.length;var t523=t1936;var t1937=function(t1191){var t524=undefined;var t1938=function(k1192,t525){var r=SPOCK.count(arguments);if(r)return r;var t1940=(t525)>=(t523);var t1939;if(t1940!==false){return ____25show(k1192,")",t486);} -else{var t1942=(t525)===(0);var t526=t1942;var t1943;if(t526!==false){t1943=false;} -else{t1943=true;} -var t1031=t1943;var t1944=function(t1193){var t1945=function(t1194){var t1946=1+(t525);return t524(k1192,t1946);};var t1948=(t492)[(t525)];return t491(t1945,t1948);};var t1195=t1944;var t1950;if(t1031!==false){return ____25show(t1195," ",t486);} -else{return t1195(undefined);} -t1939=t1950;}};t524=t1938;return t524(k1179,0);};return ____25show(t1937,"#(",t486);} -else{return t482(k1179,t492,t486);} -t1906=t1935;} -t1888=t1906;} -t1878=t1888;}};t491=t1873;return t491(k1178,t484);};___write=t1870;var t1957=function(K){SPOCK.count(arguments,'apply');var proc=arguments[1];var argc=arguments.length;var lst=arguments[argc-1];var vec=[K].concat(Array.prototype.slice.call(arguments,2,argc-1));if(lst instanceof Array)vec=vec.concat(lst);else{var len=SPOCK.length(lst);var vec2=new Array(len);for(var i=0;lst instanceof SPOCK.Pair;lst=lst.cdr) -vec2[i++]=lst.car;vec=vec.concat(vec2);} -return proc.apply(SPOCK.global,vec);};___apply=t1957;var t1958=function(k1196,t529,t530,t531){var r=SPOCK.count(arguments);if(r)return r;var t531=SPOCK.rest(arguments,3);var t1960=null;var t1959=(t531)===(t1960);var t1032=t1959;var t1961;if(t1032!==false){var t1962=(t530)instanceof Array;var t1033=t1962;var t1963;if(t1033!==false){var t1964=t530.length;var t536=t1964;var t538=undefined;var t1965=function(k1197,t539){var r=SPOCK.count(arguments);if(r)return r;var t541=t536;var t1966=(t539)>=(t541);var t1034=t1966;var t1967;if(t1034!==false){return k1197(false);} -else{var t1969=function(t1198){var t1970=(t539)+(1);return t538(k1197,t1970);};var t542=t530;var t1972=(t542)[(t539)];return t529(t1969,t1972);}};t538=t1965;return t538(k1196,0);} -else{var t546=undefined;var t1975=function(k1199,t547){var r=SPOCK.count(arguments);if(r)return r;var t1976=(t547)instanceof SPOCK.Pair;var t1035=t1976;var t1977;if(t1035!==false){var t1978=function(t1200){var t1979=t547.cdr;return t546(k1199,t1979);};var t1981=t547.car;return t529(t1978,t1981);} -else{return k1199(undefined);}};t546=t1975;return t546(k1196,t530);} -t1961=t1963;} -else{var t551=undefined;var t1985=function(k1201,t552){var r=SPOCK.count(arguments);if(r)return r;var t554=undefined;var t1986=function(k1207,t555){var r=SPOCK.count(arguments);if(r)return r;var t1988=null;var t1987=(t555)===(t1988);var t1036=t1987;var t1989;if(t1036!==false){var t1990=null;return k1207(t1990);} -else{var t1992=t555.car;var t559=t1992;var t1993=(t559)instanceof SPOCK.Pair;var t1037=t1993;var t1994;if(t1037!==false){var t1995=t559.car;var t562=t1995;var t1996=function(t1208){var t563=t1208;var t1997=new SPOCK.Pair(t562,t563);return k1207(t1997);};var t1999=t555.cdr;return t554(t1996,t1999);} -else{return k1207(false);} -t1989=t1994;}};t554=t1986;var t2002=function(t1202){var t553=t1202;var t2003;if(t553!==false){var t2004=function(t1203){var t566=undefined;var t2005=function(k1205,t567){var r=SPOCK.count(arguments);if(r)return r;var t2007=null;var t2006=(t567)===(t2007);var t1038=t2006;var t2008;if(t1038!==false){var t2009=null;return k1205(t2009);} -else{var t2011=t567.car;var t573=t2011;var t2012=t573.cdr;var t571=t2012;var t2013=function(t1206){var t572=t1206;var t2014=new SPOCK.Pair(t571,t572);return k1205(t2014);};var t2016=t567.cdr;return t566(t2013,t2016);}};t566=t2005;var t2018=function(t1204){return t551(k1201,t1204);};return t566(t2018,t552);};return ___apply(t2004,t529,t553);} -else{return k1201(undefined);}};return t554(t2002,t552);};t551=t1985;var t2024=new SPOCK.Pair(t530,t531);return t551(k1196,t2024);}};___for_2deach=t1958;var t2026=function(k1209,t578,t579,t580){var r=SPOCK.count(arguments);if(r)return r;var t580=SPOCK.rest(arguments,3);var t2028=null;var t2027=(t580)===(t2028);var t1039=t2027;var t2029;if(t1039!==false){var t2030=(t579)instanceof Array;var t1040=t2030;var t2031;if(t1040!==false){var t2032=t579.length;var t585=t2032;var t2033=function(t1210){var t587=t1210;var t588=undefined;var t2034=function(k1211,t589){var r=SPOCK.count(arguments);if(r)return r;var t591=t585;var t2035=(t589)>=(t591);var t1041=t2035;var t2036;if(t1041!==false){return k1211(t587);} -else{var t592=t587;var t593=t589;var t2038=function(t1213){var t594=t1213;var t2039=(t592)[(t593)]=(t594);var t1212=t2039;var t2040=(t589)+(1);return t588(k1211,t2040);};var t595=t579;var t2042=(t595)[(t589)];return t578(t2038,t2042);}};t588=t2034;return t588(k1209,0);};return ___make_2dvector(t2033,t585);} -else{var t599=undefined;var t2046=function(k1214,t600){var r=SPOCK.count(arguments);if(r)return r;var t2047=(t600)instanceof SPOCK.Pair;var t1042=t2047;var t2048;if(t1042!==false){var t2049=function(t1215){var t602=t1215;var t2050=function(t1216){var t603=t1216;var t2051=new SPOCK.Pair(t602,t603);return k1214(t2051);};var t2053=t600.cdr;return t599(t2050,t2053);};var t2055=t600.car;return t578(t2049,t2055);} -else{var t2057=null;return k1214(t2057);}};t599=t2046;return t599(k1209,t579);} -t2029=t2031;} -else{var t606=undefined;var t2060=function(k1217,t607){var r=SPOCK.count(arguments);if(r)return r;var t609=undefined;var t2061=function(k1224,t610){var r=SPOCK.count(arguments);if(r)return r;var t2063=null;var t2062=(t610)===(t2063);var t1043=t2062;var t2064;if(t1043!==false){var t2065=null;return k1224(t2065);} -else{var t2067=t610.car;var t614=t2067;var t2068=(t614)instanceof SPOCK.Pair;var t1044=t2068;var t2069;if(t1044!==false){var t2070=t614.car;var t617=t2070;var t2071=function(t1225){var t618=t1225;var t2072=new SPOCK.Pair(t617,t618);return k1224(t2072);};var t2074=t610.cdr;return t609(t2071,t2074);} -else{return k1224(false);} -t2064=t2069;}};t609=t2061;var t2077=function(t1218){var t608=t1218;var t2078;if(t608!==false){var t2079=function(t1219){var t621=t1219;var t623=undefined;var t2080=function(k1222,t624){var r=SPOCK.count(arguments);if(r)return r;var t2082=null;var t2081=(t624)===(t2082);var t1045=t2081;var t2083;if(t1045!==false){var t2084=null;return k1222(t2084);} -else{var t2086=t624.car;var t630=t2086;var t2087=t630.cdr;var t628=t2087;var t2088=function(t1223){var t629=t1223;var t2089=new SPOCK.Pair(t628,t629);return k1222(t2089);};var t2091=t624.cdr;return t623(t2088,t2091);}};t623=t2080;var t2093=function(t1221){var t2094=function(t1220){var t622=t1220;var t2095=new SPOCK.Pair(t621,t622);return k1217(t2095);};return t606(t2094,t1221);};return t623(t2093,t607);};return ___apply(t2079,t578,t608);} -else{var t2100=null;return k1217(t2100);}};return t609(t2077,t607);};t606=t2060;var t2103=new SPOCK.Pair(t579,t580);return t606(k1209,t2103);}};___map=t2026;var t2105=function(k1226,t637,t638,t639){var r=SPOCK.count(arguments);if(r)return r;var t2106=function(t1227){var t2107=new SPOCK.Pair(t637,t639);var t640=t2107;var t641=SPOCK.dynwinds;var t2108=new SPOCK.Pair(t640,t641);SPOCK.dynwinds=t2108 -var t2109=function(k1228){var t644=SPOCK.dynwinds;var t2110=t644.cdr;SPOCK.dynwinds=t2110 -return t639(k1228);};return ____25call_2dwith_2dsaved_2dvalues(k1226,t638,t2109);};return t637(t2106);};___dynamic_2dwind=t2105;var t2114=function(K){SPOCK.count(arguments,'%call-with-current-continuation');var proc=arguments[1];function cont(){return K.apply(SPOCK.global,Array.prototype.slice.call(arguments,1));} -return proc(K,cont);};____25call_2dwith_2dcurrent_2dcontinuation=t2114;var t645=undefined;var t2115=function(k1229,t646,t647){var r=SPOCK.count(arguments);if(r)return r;var t649=SPOCK.dynwinds;var t2116=(t649)===(t646);var t648=t2116;var t2117;if(t648!==false){return k1229(t648);} -else{var t2119=(t647)<(0);var t1046=t2119;var t2120;if(t1046!==false){var t2121=function(t1230){var t2122=t646.car;var t654=t2122;var t2123=t654.car;var t2124=function(t1231){SPOCK.dynwinds=t646 -return k1229(undefined);};return t2123(t2124);};var t2127=t646.cdr;var t2128=(t647)+1;return t645(t2121,t2127,t2128);} -else{var t658=SPOCK.dynwinds;var t2130=t658.car;var t657=t2130;var t2131=t657.cdr;var t656=t2131;var t659=SPOCK.dynwinds;var t2132=t659.cdr;SPOCK.dynwinds=t2132 -var t2133=function(t1232){var t2134=(t647)-1;return t645(k1229,t646,t2134);};return t656(t2133);} -t2117=t2120;}};t645=t2115;var t2137=function(k1233,t660){var r=SPOCK.count(arguments);if(r)return r;var t661=SPOCK.dynwinds;var t2138=function(k1234,t662){var r=SPOCK.count(arguments);if(r)return r;var t2139=function(k1235,t663){var t663=SPOCK.rest(arguments,1);var t664=SPOCK.dynwinds;var t667=t661;var t2140=(t664)===(t667);var t665=t2140;var t2141;if(t665!==false){t2141=false;} -else{t2141=true;} -var t1047=t2141;var t2142=function(t1236){return ___apply(k1235,t662,t663);};var t1237=t2142;var t2144;if(t1047!==false){var t2145=SPOCK.length(t664);var t668=t2145;var t671=t661;var t2146=SPOCK.length(t671);var t669=t2146;var t2147=(t668)-(t669);return t645(t1237,t661,t2147);} -else{return t1237(undefined);}};return t660(k1234,t2139);};return ____25call_2dwith_2dcurrent_2dcontinuation(k1233,t2138);};___call_2dwith_2dcurrent_2dcontinuation=t2137;var t2152=function(k1238,t672){var r=SPOCK.count(arguments);if(r)return r;return ___vector(k1238,t672,SPOCK.dynwinds,SPOCK.stdin,SPOCK.stdout,SPOCK.stderr);};____25get_2dcontext=t2152;var t2154=function(K){SPOCK.count(arguments,'%restore-context');var state=arguments[1];SPOCK.dynwinds=state[1];SPOCK.stdin=state[2];SPOCK.stdout=state[3];SPOCK.stderr=state[4];return(state[0])(undefined);};____25restore_2dcontext=t2154;var t2155=function(k1239,t673){var r=SPOCK.count(arguments);if(r)return r;var t2156=function(k1240,t674){var r=SPOCK.count(arguments);if(r)return r;var t2157=function(t1242){var t2158=function(t1241){var t2159=function(K){SPOCK.count(arguments);return new SPOCK.Result(undefined);};return t2159(k1240);};return t673(t2158,t1242);};return ____25get_2dcontext(t2157,t674);};return ____25call_2dwith_2dcurrent_2dcontinuation(k1239,t2156);};___suspend=t2155;var t2164=function(k1243,t675){var r=SPOCK.count(arguments);if(r)return r;var t676=false;var t677=false;var t2166=function(k1244){var t2167;if(t676!==false){return ___apply(k1244,___values,t677);} -else{var t2169=function(k1245,t678){var t678=SPOCK.rest(arguments,1);var t2170;if(t676!==false){return ___apply(k1245,___values,t677);} -else{t676=true;t677=t678;return ___apply(k1245,___values,t677);}};return ___call_2dwith_2dvalues(k1244,t675,t2169);}};var t2165=new SPOCK.Promise(t2166);return k1243(t2165);};____25make_2dpromise=t2164;var t2175=function(k1246,t679){var r=SPOCK.count(arguments);if(r)return r;var t2177=(t679)instanceof SPOCK.Promise;var t2176;if(t2177!==false){var t2178=t679.thunk;return t2178(k1246);} -else{return k1246(t679);}};___force=t2175;var t680=___dynamic_2dwind;var t2181=function(k1247,t681,t682){var r=SPOCK.count(arguments);if(r)return r;var t686=false;var t2182=function(k1248){loop:while(true){t686=SPOCK.stdin;SPOCK.stdin=t681 -return k1248(undefined);}};var t2184=function(k1249){loop:while(true){SPOCK.stdin=t686 -return k1249(undefined);}};return t680(k1247,t2182,t682,t2184);};___with_2dinput_2dfrom_2dport=t2181;var t687=___dynamic_2dwind;var t2187=function(k1250,t688,t689){var r=SPOCK.count(arguments);if(r)return r;var t693=false;var t2188=function(k1251){loop:while(true){t693=SPOCK.stdout;SPOCK.stdout=t688 -return k1251(undefined);}};var t2190=function(k1252){loop:while(true){SPOCK.stdout=t693 -return k1252(undefined);}};return t687(k1250,t2188,t689,t2190);};___with_2doutput_2dto_2dport=t2187;var t2193=function(K){SPOCK.count(arguments,'%close-port');var port=arguments[1];port.close();port.closed=true;return K(port);};____25close_2dport=t2193;var t2194=function(K){SPOCK.count(arguments,'open-input-file');var fn=SPOCK.check(arguments[1],'string','open-input-file');return K(SPOCK.openInputFile(fn));};___open_2dinput_2dfile=t2194;var t2195=function(K){SPOCK.count(arguments,'open-output-file');var fn=SPOCK.check(arguments[1],'string','open-input-file');var exp=null;if(arguments.length===3) -exp=SPOCK.check(arguments[2],'number','open-input-file');return K(SPOCK.openOutputFile(fn,exp));};___open_2doutput_2dfile=t2195;var t2196=function(k1253,t694){var r=SPOCK.count(arguments);if(r)return r;var t695=t694;return ____25close_2dport(k1253,t695);};___close_2dinput_2dport=t2196;var t2198=function(k1254,t699){var r=SPOCK.count(arguments);if(r)return r;var t700=t699;return ____25close_2dport(k1254,t700);};___close_2doutput_2dport=t2198;var t705=___open_2dinput_2dfile;var t2200=function(k1255,t708,t709){var r=SPOCK.count(arguments);if(r)return r;var t2201=function(t1256){var t710=t1256;var t2202=function(k1257){return t709(k1257,t710);};var t2204=function(k1258){return ___close_2dinput_2dport(k1258,t710);};return ____25call_2dwith_2dsaved_2dvalues(k1255,t2202,t2204);};return t705(t2201,t708);};___call_2dwith_2dinput_2dfile=t2200;var t712=___open_2doutput_2dfile;var t2208=function(k1259,t715,t716){var r=SPOCK.count(arguments);if(r)return r;var t2209=function(t1260){var t717=t1260;var t2210=function(k1261){return t716(k1261,t717);};var t2212=function(k1262){return ___close_2doutput_2dport(k1262,t717);};return ____25call_2dwith_2dsaved_2dvalues(k1259,t2210,t2212);};return t712(t2209,t715);};___call_2dwith_2doutput_2dfile=t2208;var t718=___with_2dinput_2dfrom_2dport;var t719=___open_2dinput_2dfile;var t723=___close_2dinput_2dport;var t2216=function(k1263,t724,t725){var r=SPOCK.count(arguments);if(r)return r;var t2217=function(t1264){var t726=t1264;var t2218=function(k1265){var t2219=function(k1266){return t723(k1266,t726);};return ____25call_2dwith_2dsaved_2dvalues(k1265,t725,t2219);};return t718(k1263,t726,t2218);};return t719(t2217,t724);};___with_2dinput_2dfrom_2dfile=t2216;var t727=___with_2doutput_2dto_2dport;var t728=___open_2doutput_2dfile;var t732=___close_2doutput_2dport;var t2224=function(k1267,t733,t734){var r=SPOCK.count(arguments);if(r)return r;var t2225=function(t1268){var t735=t1268;var t2226=function(k1269){var t2227=function(k1270){return t732(k1270,t735);};return ____25call_2dwith_2dsaved_2dvalues(k1269,t734,t2227);};return t727(k1267,t735,t2226);};return t728(t2225,t733);};___with_2doutput_2dto_2dfile=t2224;var t2232=function(k1271,t736){var r=SPOCK.count(arguments);if(r)return r;var t737=undefined;var t2233=function(K){SPOCK.count(arguments,'t737');var buffer=arguments[1];var pos=0;var len=buffer.length;function read(n){if(pos>=len)return SPOCK.EOF;var str=buffer.substring(pos,pos+n);pos+=n;return str;} -return K(new SPOCK.Port('input',{read:read}));};t737=t2233;var t2234=SPOCK.jstring(t736);return t737(k1271,t2234);};___open_2dinput_2dstring=t2232;var t2236=function(K){SPOCK.count(arguments,'open-output-string');var buffer=[];function write(s){buffer.push(s);} -var port=new SPOCK.Port('output',{write:write});port.buffer=buffer;port.isStringPort=true;return K(port);};___open_2doutput_2dstring=t2236;var t2237=function(k1272,t739){var r=SPOCK.count(arguments);if(r)return r;loop:while(true){var t2238=t739.isStringPort;var t742=t2238;var t2239=t742===undefined;var t741=t2239;var t2240;if(t741!==false){t2240=false;} -else{t2240=true;} -var t1048=t2240;var t2241;if(t1048!==false){var t2243=t739.buffer;var t2242=t2243.join("");var t744=t2242;var t2244=new SPOCK.String(t744);var t743=t2244;var t2245=(t739).buffer=[];t2241=t743;} -else{var t2246=SPOCK.error("bad argument type - not a string port",t739);t2241=t2246;} -return k1272(t2241);}};___get_2doutput_2dstring=t2237;var t2248=function(k1273,t745,t746){var r=SPOCK.count(arguments);if(r)return r;var t2249=function(t1274){var t747=t1274;return ___with_2dinput_2dfrom_2dport(k1273,t747,t746);};return ___open_2dinput_2dstring(t2249,t745);};___with_2dinput_2dfrom_2dstring=t2248;var t2252=function(k1275,t748){var r=SPOCK.count(arguments);if(r)return r;var t2253=function(t1276){var t749=t1276;var t2254=function(t1277){return ___get_2doutput_2dstring(k1275,t749);};return ___with_2doutput_2dto_2dport(t2254,t749,t748);};return ___open_2doutput_2dstring(t2253);};___with_2doutput_2dto_2dstring=t2252;var t750=___read_2dchar;var t751=___reverse;var t752=___peek_2dchar;var t753=___list_2d_3evector;var t754=___list_2d_3estring;var t2258=function(k1278){loop:while(true){return k1278(SPOCK.stdin);}};var t755=t2258;var t756=___string_2d_3enumber;var t2260=function(k1279,t757){var r=SPOCK.count(arguments);if(r)return r;var t2261=t757===undefined;var t1049=t2261;var t2262=function(t1280){var t758=t1280;var t760=undefined;var t761=undefined;var t762=undefined;var t763=undefined;var t764=undefined;var t765=undefined;var t766=undefined;var t767=undefined;var t2263=function(k1281,t768){var r=SPOCK.count(arguments);if(r)return r;var t2264=function(t1282){var t769=t1282;var t2265;if(t769!==false){return k1281(t769);} -else{return ___string_2d_3esymbol(k1281,t768);}};return t756(t2264,t768);};t760=t2263;var t2269=function(k1283){var t2270=function(t1284){var t770=t1284;var t773=SPOCK.EOF;var t2271=(t770)===(t773);var t1050=t2271;var t2272;if(t1050!==false){return k1283(t770);} -else{var t774=t770;var t2276=new SPOCK.Char("#");var t2275=SPOCK.eqvp(t770,t2276);var t1051=t2275;var t2277;if(t1051!==false){t2277=true;} -else{t2277=false;} -var t2274;if(t2277!==false){return t764(k1283);} -else{var t2281=new SPOCK.Char("(");var t2280=SPOCK.eqvp(t774,t2281);var t1052=t2280;var t2282;if(t1052!==false){t2282=true;} -else{t2282=false;} -var t2279;if(t2282!==false){var t2283=new SPOCK.Char(")");return t765(k1283,t2283);} -else{var t2287=new SPOCK.Char("[");var t2286=SPOCK.eqvp(t774,t2287);var t1053=t2286;var t2288;if(t1053!==false){t2288=true;} -else{t2288=false;} -var t2285;if(t2288!==false){var t2289=new SPOCK.Char("]");return t765(k1283,t2289);} -else{var t2293=new SPOCK.Char("{");var t2292=SPOCK.eqvp(t774,t2293);var t1054=t2292;var t2294;if(t1054!==false){t2294=true;} -else{t2294=false;} -var t2291;if(t2294!==false){var t2295=new SPOCK.Char("}");return t765(k1283,t2295);} -else{var t2299=new SPOCK.Char(",");var t2298=SPOCK.eqvp(t774,t2299);var t1055=t2298;var t2300;if(t1055!==false){t2300=true;} -else{t2300=false;} -var t2297;if(t2300!==false){var t2301=function(t1285){var t785=t1285;var t2303=new SPOCK.Char("@");var t2302=SPOCK.eqvp(t785,t2303);var t1056=t2302;var t2304;if(t1056!==false){var t2305=function(t1287){var t2306=function(t1286){var t787=t1286;return k1283(t787);};var t2308=SPOCK.intern("unquote-splicing");return ____25list(t2306,t2308,t1287);};return t761(t2305);} -else{var t2311=function(t1289){var t2312=function(t1288){var t788=t1288;return k1283(t788);};var t2314=SPOCK.intern("unquote");return ____25list(t2312,t2314,t1289);};return t761(t2311);}};return t752(t2301,t758);} -else{var t2320=new SPOCK.Char("`");var t2319=SPOCK.eqvp(t774,t2320);var t1057=t2319;var t2321;if(t1057!==false){t2321=true;} -else{t2321=false;} -var t2318;if(t2321!==false){var t2322=function(t1291){var t2323=function(t1290){var t791=t1290;return k1283(t791);};var t2325=SPOCK.intern("quasiquote");return ____25list(t2323,t2325,t1291);};return t761(t2322);} -else{var t2330=new SPOCK.Char("'");var t2329=SPOCK.eqvp(t774,t2330);var t1058=t2329;var t2331;if(t1058!==false){t2331=true;} -else{t2331=false;} -var t2328;if(t2331!==false){var t2332=function(t1293){var t2333=function(t1292){var t794=t1292;return k1283(t794);};var t2335=SPOCK.intern("quote");return ____25list(t2333,t2335,t1293);};return t761(t2332);} -else{var t2340=new SPOCK.Char(";");var t2339=SPOCK.eqvp(t774,t2340);var t1059=t2339;var t2341;if(t1059!==false){t2341=true;} -else{t2341=false;} -var t2338;if(t2341!==false){var t2342=function(t1294){return t761(k1283);};return t762(t2342);} -else{var t2347=new SPOCK.Char("\"");var t2346=SPOCK.eqvp(t774,t2347);var t1060=t2346;var t2348;if(t1060!==false){t2348=true;} -else{t2348=false;} -var t2345;if(t2348!==false){return t766(k1283);} -else{var t2352=new SPOCK.Char(")");var t2351=SPOCK.eqvp(t774,t2352);var t1061=t2351;var t2353;if(t1061!==false){t2353=true;} -else{var t2355=new SPOCK.Char("]");var t2354=SPOCK.eqvp(t774,t2355);var t1062=t2354;var t2356;if(t1062!==false){t2356=true;} -else{var t2358=new SPOCK.Char("}");var t2357=SPOCK.eqvp(t774,t2358);var t1063=t2357;var t2359;if(t1063!==false){t2359=true;} -else{t2359=false;} -t2356=t2359;} -t2353=t2356;} -var t2350;if(t2353!==false){return ____25error(k1283,"unexpected delimiter",t770);} -else{var t2361=(t770).character.match(/^\s$/);var t807=t2361;var t2363=null;var t2362=(t807)===(t2363);var t806=t2362;var t2364;if(t806!==false){t2364=false;} -else{t2364=true;} -var t1064=t2364;var t2365;if(t1064!==false){return t761(k1283);} -else{var t2367=function(t1297){var t810=t1297;var t1296=t810;var t2368=function(t1295){return t760(k1283,t1295);};return t767(t2368,t1296);};return ____25list(t2367,t770);} -t2350=t2365;} -t2345=t2350;} -t2338=t2345;} -t2328=t2338;} -t2318=t2328;} -t2297=t2318;} -t2291=t2297;} -t2285=t2291;} -t2279=t2285;} -t2274=t2279;} -t2272=t2274;}};return t750(t2270,t758);};t761=t2269;var t2373=function(k1298){var t2374=function(t1299){var t811=t1299;var t816=SPOCK.EOF;var t2375=(t811)===(t816);var t813=t2375;var t2376;if(t813!==false){t2376=t813;} -else{var t2378=new SPOCK.Char("\n");var t2377=t2378.character;var t819=t2377;var t2379=t811.character;var t820=t2379;var t2380=(t819)===(t820);t2376=t2380;} -var t812=t2376;var t2381;if(t812!==false){t2381=false;} -else{t2381=true;} -var t1065=t2381;var t2382;if(t1065!==false){return t762(k1298);} -else{return k1298(undefined);}};return t750(t2374,t758);};t762=t2373;var t2386=function(k1300){var t2387=function(t1301){var t821=t1301;var t2388=(t821).character.match(/^\s$/);var t824=t2388;var t2390=null;var t2389=(t824)===(t2390);var t823=t2389;var t2391;if(t823!==false){t2391=false;} -else{t2391=true;} -var t1066=t2391;var t2392;if(t1066!==false){var t2393=function(t1302){return t763(k1300);};return t750(t2393,t758);} -else{return k1300(t821);}};return t752(t2387,t758);};t763=t2386;var t2398=function(k1303){var t2399=function(t1304){var t827=t1304;var t830=SPOCK.EOF;var t2400=(t827)===(t830);var t1067=t2400;var t2401;if(t1067!==false){return ____25error(k1303,"unexpected EOF after `#'");} -else{var t831=t827;var t2405=new SPOCK.Char("t");var t2404=SPOCK.eqvp(t827,t2405);var t1068=t2404;var t2406;if(t1068!==false){t2406=true;} -else{var t2408=new SPOCK.Char("T");var t2407=SPOCK.eqvp(t827,t2408);var t1069=t2407;var t2409;if(t1069!==false){t2409=true;} -else{t2409=false;} -t2406=t2409;} -var t2403;if(t2406!==false){return k1303(true);} -else{var t2413=new SPOCK.Char("f");var t2412=SPOCK.eqvp(t827,t2413);var t1070=t2412;var t2414;if(t1070!==false){t2414=true;} -else{var t2416=new SPOCK.Char("F");var t2415=SPOCK.eqvp(t827,t2416);var t1071=t2415;var t2417;if(t1071!==false){t2417=true;} -else{t2417=false;} -t2414=t2417;} -var t2411;if(t2414!==false){return k1303(false);} -else{var t2421=new SPOCK.Char("(");var t2420=SPOCK.eqvp(t827,t2421);var t1072=t2420;var t2422;if(t1072!==false){t2422=true;} -else{t2422=false;} -var t2419;if(t2422!==false){var t2423=function(t1305){return t753(k1303,t1305);};var t2425=new SPOCK.Char(")");return t765(t2423,t2425);} -else{var t2429=new SPOCK.Char("%");var t2428=SPOCK.eqvp(t831,t2429);var t1073=t2428;var t2430;if(t1073!==false){t2430=true;} -else{var t2432=new SPOCK.Char("!");var t2431=SPOCK.eqvp(t831,t2432);var t1074=t2431;var t2433;if(t1074!==false){t2433=true;} -else{t2433=false;} -t2430=t2433;} -var t2427;if(t2430!==false){var t2434=function(t1308){var t846=t1308;var t1307=t846;var t2435=function(t1306){return ___string_2d_3esymbol(k1303,t1306);};return t767(t2435,t1307);};var t2438=new SPOCK.Char("#");return ____25list(t2434,t827,t2438);} -else{var t2442=new SPOCK.Char("\\");var t2441=SPOCK.eqvp(t831,t2442);var t1075=t2441;var t2443;if(t1075!==false){t2443=true;} -else{t2443=false;} -var t2440;if(t2443!==false){var t2444=function(t1309){var t849=t1309;var t2446=SPOCK.jstring("newline");var t2445=t2446.toLowerCase();var t852=t2445;var t2448=SPOCK.jstring(t849);var t2447=t2448.toLowerCase();var t853=t2447;var t2449=(t852)===(t853);var t1076=t2449;var t2450;if(t1076!==false){var t2451=new SPOCK.Char("\n");return k1303(t2451);} -else{var t2454=SPOCK.jstring("tab");var t2453=t2454.toLowerCase();var t858=t2453;var t2456=SPOCK.jstring(t849);var t2455=t2456.toLowerCase();var t859=t2455;var t2457=(t858)===(t859);var t1077=t2457;var t2458;if(t1077!==false){var t2459=new SPOCK.Char("\t");return k1303(t2459);} -else{var t2462=SPOCK.jstring("space");var t2461=t2462.toLowerCase();var t864=t2461;var t2464=SPOCK.jstring(t849);var t2463=t2464.toLowerCase();var t865=t2463;var t2465=(t864)===(t865);var t1078=t2465;var t2466;if(t1078!==false){var t2467=new SPOCK.Char(" ");return k1303(t2467);} -else{var t2470=SPOCK.jstring(t849);var t2469=t2470.length;var t868=t2469;var t2471=(0)===(t868);var t1079=t2471;var t2472;if(t1079!==false){return ____25error(k1303,"invalid character syntax");} -else{return ___string_2dref(k1303,t849,0);} -t2466=t2472;} -t2458=t2466;} -t2450=t2458;}};var t2475=null;return t767(t2444,t2475);} -else{return ____25error(k1303,"invalid `#' syntax",t827);} -t2427=t2440;} -t2419=t2427;} -t2411=t2419;} -t2403=t2411;} -t2401=t2403;}};return t750(t2399,t758);};t764=t2398;var t2479=function(k1310,t873){var r=SPOCK.count(arguments);if(r)return r;var t874=undefined;var t2480=function(k1311,t875){var r=SPOCK.count(arguments);if(r)return r;var t2481=function(t1312){var t876=t1312;var t879=SPOCK.EOF;var t2482=(t876)===(t879);var t1080=t2482;var t2483;if(t1080!==false){return ____25error(k1311,"unexpected EOF while reading list");} -else{var t881=t873;var t2485=t876.character;var t882=t2485;var t2486=t881.character;var t883=t2486;var t2487=(t882)===(t883);var t1081=t2487;var t2488;if(t1081!==false){var t2489=function(t1313){return t751(k1311,t875);};return t750(t2489,t758);} -else{var t2493=new SPOCK.Char(".");var t2492=SPOCK.eqvp(t2493,t876);var t1082=t2492;var t2494;if(t1082!==false){var t2495=function(t1314){var t886=t1314;var t2496=SPOCK.jstring(".");var t889=t2496;var t2497=SPOCK.jstring(t886);var t890=t2497;var t2498=(t889)===(t890);var t1083=t2498;var t2499;if(t1083!==false){var t2500=function(t1315){var t893=t1315;var t2501=function(t1316){var t2502=function(t1317){var t894=t1317;var t895=t873;var t2503=SPOCK.eqvp(t894,t895);var t1084=t2503;var t2504;if(t1084!==false){var t2505=function(t1318){return ___append(k1311,t1318,t893);};return t751(t2505,t875);} -else{return ____25error(k1311,"missing closing delimiter",t873);}};return t750(t2502,t758);};return t763(t2501);};return t761(t2500);} -else{var t2512=function(t1320){var t896=t1320;var t2513=new SPOCK.Pair(t896,undefined);var t1319=t2513;return t874(k1311,t1319,t875);};return t760(t2512,t886);}};var t2516=null;return t767(t2495,t2516);} -else{var t2518=function(t1322){var t898=t1322;var t2519=new SPOCK.Pair(t898,t875);var t1321=t2519;return t874(k1311,t1321);};return t761(t2518);} -t2488=t2494;} -t2483=t2488;}};return t763(t2481);};t874=t2480;var t2523=null;return t874(k1310,t2523);};t765=t2479;var t2525=function(k1323){var t900=undefined;var t2526=function(k1324,t901){var r=SPOCK.count(arguments);if(r)return r;var t2527=function(t1325){var t902=t1325;var t905=SPOCK.EOF;var t2528=(t902)===(t905);var t1085=t2528;var t2529;if(t1085!==false){return ____25error(k1324,"unexpected EOF while reading string");} -else{var t2532=new SPOCK.Char("\"");var t2531=t2532.character;var t908=t2531;var t2533=t902.character;var t909=t2533;var t2534=(t908)===(t909);var t1086=t2534;var t2535;if(t1086!==false){var t2536=function(t1326){return t754(k1324,t1326);};return t751(t2536,t901);} -else{var t2540=new SPOCK.Char("\\");var t2539=t2540.character;var t912=t2539;var t2541=t902.character;var t913=t2541;var t2542=(t912)===(t913);var t1087=t2542;var t2543;if(t1087!==false){var t2544=function(t1327){var t914=t1327;var t917=SPOCK.EOF;var t2545=(t914)===(t917);var t1088=t2545;var t2546;if(t1088!==false){return ____25error(k1324,"unexpected EOF while reading string");} -else{var t2550=new SPOCK.Char("n");var t2549=SPOCK.eqvp(t914,t2550);var t1089=t2549;var t2551;if(t1089!==false){t2551=true;} -else{t2551=false;} -var t2548;if(t2551!==false){var t2553=new SPOCK.Char("\n");var t2552=new SPOCK.Pair(t2553,t901);return t900(k1324,t2552);} -else{var t2557=new SPOCK.Char("t");var t2556=SPOCK.eqvp(t914,t2557);var t1090=t2556;var t2558;if(t1090!==false){t2558=true;} -else{t2558=false;} -var t2555;if(t2558!==false){var t2560=new SPOCK.Char("\t");var t2559=new SPOCK.Pair(t2560,t901);return t900(k1324,t2559);} -else{var t2562=new SPOCK.Pair(t914,t901);return t900(k1324,t2562);} -t2548=t2555;} -t2546=t2548;}};return t750(t2544,t758);} -else{var t2565=new SPOCK.Pair(t902,t901);return t900(k1324,t2565);} -t2535=t2543;} -t2529=t2535;}};return t750(t2527,t758);};t900=t2526;var t2568=null;return t900(k1323,t2568);};t766=t2525;var t2570=function(k1328,t931){var r=SPOCK.count(arguments);if(r)return r;var t932=undefined;var t2571=function(k1329,t933){var r=SPOCK.count(arguments);if(r)return r;var t2572=function(t1330){var t934=t1330;var t938=SPOCK.EOF;var t2573=(t934)===(t938);var t935=t2573;var t2574=function(t1331){var t1091=t1331;var t2575;if(t1091!==false){var t2576=function(t1332){return t754(k1329,t1332);};return t751(t2576,t933);} -else{var t2579=function(t1334){var t945=t1334;var t2580=new SPOCK.Pair(t945,t933);var t1333=t2580;return t932(k1329,t1333);};return t750(t2579,t758);}};var t1335=t2574;var t2583;if(t935!==false){return t1335(t935);} -else{var t2585=function(t1336){var t939=t1336;var t2586;if(t939!==false){t2586=t939;} -else{var t2587=(t934).character.match(/^\s$/);var t942=t2587;var t2589=null;var t2588=(t942)===(t2589);var t941=t2588;var t2590;if(t941!==false){t2590=false;} -else{t2590=true;} -t2586=t2590;} -return t1335(t2586);};var t2592=new SPOCK.Pair(new SPOCK.Char("{"),new SPOCK.Pair(new SPOCK.Char("}"),new SPOCK.Pair(new SPOCK.Char("("),new SPOCK.Pair(new SPOCK.Char(")"),new SPOCK.Pair(new SPOCK.Char("["),new SPOCK.Pair(new SPOCK.Char("]"),new SPOCK.Pair(new SPOCK.Char(";"),new SPOCK.Pair(new SPOCK.Char("\""),null))))))));return ___memv(t2585,t934,t2592);}};return t752(t2572,t758);};t932=t2571;return t932(k1328,t931);};t767=t2570;return t761(k1279);};var t1337=t2262;var t2597;if(t1049!==false){return t755(t1337);} -else{return t1337(t757);}};___read=t2260;var t2600=function(k1338,t947,t948){var r=SPOCK.count(arguments);if(r)return r;loop:while(true){var t2602=SPOCK.jstring(t947);var t2603=t948===undefined;var t950=t2603;var t2604;if(t950!==false){t2604=false;} -else{t2604=true;} -var t1092=t2604;var t2605;if(t1092!==false){var t2606=SPOCK.callback(t948);t2605=t2606;} -else{t2605=false;} -var t2601=SPOCK.load(t2602,t2605);return k1338(t2601);}};___load=t2600;var t2608=function(K){SPOCK.count(arguments,'%error');SPOCK.error.apply(SPOCK.global,Array.prototype.slice.call(arguments,1));};____25error=t2608;___error=____25error;var t2609=function(k1339,t952){var r=SPOCK.count(arguments);if(r)return r;loop:while(true){var t2611=t952===undefined;var t1093=t2611;var t2612;if(t1093!==false){t2612=0;} -else{t2612=t952;} -var t2610=SPOCK.exit(t2612);return k1339(t2610);}};___exit=t2609;var t2614=function(k1340,t954){var r=SPOCK.count(arguments);if(r)return r;var t2615=(new Date()).getTime();var t955=t2615;var t2616=t954===undefined;var t1094=t2616;var t2617;if(t1094!==false){return k1340(t955);} -else{var t2619=function(t1341){var t2620=(new Date()).getTime();var t958=t2620;var t2621=(t958)-(t955);return k1340(t2621);};return t954(t2619);}};___milliseconds=t2614;var t2624=function(k1342,t959){var t959=SPOCK.rest(arguments,1);var t2625=function(t1343){return ___newline(k1342);};return ___for_2deach(t2625,___display,t959);};___print=t2624;var t2628=function(k1344,t960){var t960=SPOCK.rest(arguments,1);var t2630=null;var t2629=(t960)===(t2630);var t1095=t2629;var t2631;if(t1095!==false){var t2632=function(k1345,t964){var r=SPOCK.count(arguments);if(r)return r;loop:while(true){return k1345(t964);}};return k1344(t2632);} -else{var t965=undefined;var t2635=function(k1346,t966){var r=SPOCK.count(arguments);if(r)return r;var t2636=t966.car;var t967=t2636;var t2637=t966.cdr;var t968=t2637;var t2639=null;var t2638=(t968)===(t2639);var t1096=t2638;var t2640;if(t1096!==false){t2640=t967;} -else{var t2641=function(k1347,t974){var r=SPOCK.count(arguments);if(r)return r;var t2642=function(t1349){var t2643=function(t1348){return t967(k1347,t1348);};return t1349(t2643,t974);};return t965(t2642,t968);};t2640=t2641;} -return k1346(t2640);};t965=t2635;return t965(k1344,t960);}};___o=t2628;var t2649=function(K){SPOCK.count(arguments,'%');var o={};for(var i=1;i<arguments.length;i+=2){var x=arguments[i];if(typeof x==='string')o[x]=arguments[i+1];else if(x instanceof SPOCK.String) -o[x.name]=arguments[i+1];else SPOCK.error('(%) object key not a string or symbol',x);} -return K(o);};____25=t2649;var t2650=function(K){SPOCK.count(arguments,'native');var func=arguments[1];return K(function(k){var args=Array.prototype.splice.call(arguments,1);return k(func.apply(SPOCK.global,args));});};___native=t2650;var t2651=function(K){SPOCK.count(arguments,'native-method');var func=arguments[1];return K(function(k){var args=Array.prototype.splice.call(arguments,2);return k(func.apply(arguments[1],args));});};___native_2dmethod=t2651;var t2652=function(K){SPOCK.count(arguments,'bind-method');var func=arguments[1];var that=arguments[2];return K(function(){return func.apply(that,arguments);});};___bind_2dmethod=t2652;var t2653=function(K){SPOCK.count(arguments,'jstring');var x=arguments[1];if(typeof x==='string')return K(x);else if(x instanceof SPOCK.String)return K(x.normalize());else if(x instanceof SPOCK.Char)return K(x.character);else return K(x);};___jstring=t2653;return k1097(undefined);};SPOCK.run(t1350);SPOCK.flush(); -\ No newline at end of file diff --git a/spock-runtime.js b/spock-runtime.js @@ -1,4524 +0,0 @@ -/* config.js - runtime-configuration for SPOCK */ - - -var SPOCK = { - STACKSIZE: 100, - THREADSLICE: 10, - TRACELENGTH: 32 -}; -/* runtime.js - SPOCK runtime (javascript part) */ - - -SPOCK.modules = {}; -SPOCK.symbolTable = {}; -SPOCK.stack = 0; -SPOCK.limit = SPOCK.STACKSIZE; -SPOCK.debug = false; -SPOCK.running = false; -SPOCK.runHook = []; -SPOCK.inBrowser = "document" in this; -SPOCK.global = this; - -SPOCK.Continuation = function(func, args) { - this.k_callee = func; - this.k_arguments = args; -}; - -SPOCK.Result = function(val) { - this.value = val; -}; - -SPOCK.Symbol = function(name) { - this.name = name; - this.plist = {}; -}; - -SPOCK.Pair = function(car, cdr) { - this.car = car; - this.cdr = cdr; -}; - -SPOCK.String = function(chars) { - if(typeof chars === "string") { - this.parts = [chars]; - this.length = chars.length; - } - else if(typeof chars === "number") this.parts = [chars.toString()]; - else this.parts = chars; // assumes chars is array -}; - -SPOCK.Char = function(str) { - this.character = str.charAt(0); -}; - -SPOCK.Port = function(direction, methods) { - var port = this; - var read = methods.read || function() { - SPOCK.error("reading from non-input port", port); - }; - - function doread(n) { - if(n === 0) return ""; - else if(this.peeked) { - var p = this.peeked; - this.peeked = false; - - if(n === 1) return p; - else return p + read(n - 1); - } - else return read(n); - } - - this.peeked = false; - this.direction = direction; - this.read = doread; - this.write = methods.write || function() { - SPOCK.error("writing to non-output port", port) - }; - this.close = methods.close || function() {}; - this.flush = methods.flush || function() {}; - this.ready = methods.ready || function() { return true; }; - this.closed = false; -}; - -SPOCK.Promise = function(thunk) { - this.thunk = thunk; -}; - -SPOCK.EndOfFile = function() {}; -SPOCK.EOF = new SPOCK.EndOfFile(); - -SPOCK.check = function(val, type, loc) { - if(typeof type === "function" && val instanceof type) return val; - if(typeof val === type) return val; - else SPOCK.error((loc ? "(" + loc + ") " : "") + - "bad argument type" + - (typeof type === "string" ? " - expected `" + type + "'" : ""), - val); -}; - -SPOCK.intern = function(str) { - var old = SPOCK.symbolTable[ str ]; - - if(old) return old; - else return SPOCK.symbolTable[ str ] = new SPOCK.Symbol(str); -}; - -SPOCK.stringify = function(x, readable) { - if(readable === undefined) readable = true; - - if(typeof x === "function") return "#<procedure>"; - else if(x === undefined) return "#<undefined>"; - else if(x === null) return "()"; - else if(x instanceof SPOCK.Continuation) return "#<continuation>"; - else if(x instanceof SPOCK.Symbol) return x.name; - else if(x instanceof SPOCK.Pair) { - var str = "("; - var f = false; - - for(var p = x; p !== null && p instanceof SPOCK.Pair; p = p.cdr) { - if(f) str += " "; - - str += SPOCK.stringify(p.car, readable); - f = true; - } - - if(p !== null) str += " . " + SPOCK.stringify(p, readable); - - return str + ")"; - } - else if(x instanceof Array) { - var str = "#("; - var f = false; - - for(var i in x) { - if(f) str += " "; - - str += SPOCK.stringify(x[ i ], readable); - f = true; - } - - return str + ")"; - } - else if(x instanceof SPOCK.String) { - if(readable) - return "\"" + x.normalize() + "\""; // XXX does not escape embedded characters - else return x.normalize(); - } - else if(x instanceof SPOCK.Char) { - if(readable) return x.character; - - switch(x.character) { - case "\n": return "#\\newline"; - case "\t": return "#\\tab"; - case "\r": return "#\\return"; - case " ": return "#\\space"; - default: return "#\\" + x.character; - } - } - else if(x instanceof SPOCK.Port) - return "#<" + x.direction + " port" + - (x.name ? (" \"" + x.name + "\">") : ">"); - else if(x instanceof SPOCK.Promise) return "#<promise>"; - else if(x instanceof SPOCK.EndOfFile) return "#<eof>"; - else return x.toString(); -}; - -SPOCK.error = function(msg) { - var args = Array.prototype.splice.call(arguments, 1); - - function argstr(x) { - return SPOCK.stringify(x, true); - } - - if(args.length > 0) - msg = msg + ":\n " + SPOCK.map(argstr, args).join("\n "); - - throw new Error(msg); -}; - -if(this.quit) SPOCK.exit = quit; -else SPOCK.exit = function(code) { - SPOCK.error("no suitable primitive available for `exit'"); - }; - -SPOCK.String.prototype.normalize = function() { - if(this.parts.length === 0) return ""; - - this.parts = [this.parts.join("")]; - return this.parts[ 0 ]; -}; - -SPOCK.jstring = function(x) { - if(typeof x === "string") return x; - else if(x instanceof SPOCK.String) return x.normalize(); - else return x; -}; - -SPOCK.list = function() { - var lst = null; - var len = arguments.length; - - for(var i = len - 1; i >= 0; --i) - lst = new SPOCK.Pair(arguments[ i ], lst); - - return lst; -}; - -SPOCK.length = function(lst) { - for(var n = 0; lst instanceof SPOCK.Pair; ++n) - lst = lst.cdr; - - return n; -}; - -SPOCK.map = function(func, array) { - var len = array.length; - var a2 = new Array(len); - - for(var i in array) - a2[ i ] = func(array[ i ]); - - return a2; -}; - -SPOCK.eqvp = function(x, y) { - if(x === y) return true; - else if(x instanceof SPOCK.Char) - return y instanceof SPOCK.Char && x.character === y.character; - else return false; -}; - -SPOCK.equalp = function(x, y) { - if(x === y) return true; - else if(x instanceof SPOCK.Pair) - return y instanceof SPOCK.Pair && - SPOCK.equalp(x.car, y.car) && - SPOCK.equalp(x.cdr, y.cdr); - else if(x instanceof Array) { - var len = x.length; - if(!(y instanceof Array) || y.length != len) return false; - for(var i = 0; i < len; ++i) { - if(!SPOCK.equalp(x[ i ], y[ i ])) return false; - } - return true; - } - else if(x instanceof SPOCK.Char) - return y instanceof SPOCK.Char && x.characters === y.characters; - else if(x instanceof SPOCK.String) { - var s1 = x.normalize(); - - if(y instanceof SPOCK.String) return s1 === y.normalize(); - else if(typeof y === 'string') return s1 === y; - else return false; - } - else if(typeof x === 'string') { - if(y instanceof SPOCK.String) return x === y.normalize(); - else if(typeof y === 'string') return x === y; - else return false; - } - else return false; -}; - -SPOCK.count = function(args, loc) { - if(--SPOCK.stack <= 0) - return new SPOCK.Continuation(args.callee, Array.prototype.slice.call(args)); - else return false; -}; - -SPOCK.rest = function(args, count, loc) { - var rest = null; - - // this will not unwind, but decrease the counter - SPOCK.count(args, loc); - - for(var i = args.length - 1; i >= count; --i) - rest = new SPOCK.Pair(args[ i ], rest); - - return rest; -}; - -SPOCK.statistics = function() {}; - -SPOCK.run = function(func) { // optional arguments - function terminate(result) { - return new SPOCK.Result(result); - } - - var k = terminate; - var args = [k].concat(Array.prototype.slice.call(arguments, 1)); - var oldstack = SPOCK.stack; - var oldlimit = SPOCK.limit; - var oldrunning = SPOCK.running; - SPOCK.limit = Math.max(10, oldlimit - oldstack); - SPOCK.stack = SPOCK.limit; - SPOCK.running = true; - - function restore() { - SPOCK.stack = oldstack; - SPOCK.limit = oldlimit; - SPOCK.running = oldrunning; - - if(!oldrunning) { - for(var i in SPOCK.runHook) - (SPOCK.runHook[ i ])(false); - } - } - - var result; - - if(!oldrunning) { - for(var i in SPOCK.runHook) - (SPOCK.runHook[ i ])(true); - } - - while(true) { - result = func.apply(SPOCK.global, args); - - if(result instanceof SPOCK.Continuation) { - SPOCK.stack = SPOCK.STACKSIZE; - func = result.k_callee; - args = result.k_arguments; - } - else if(result instanceof SPOCK.Result) { - restore(); - return result.value; - } - else { - restore(); - SPOCK.error("unexpected return of non-continuation", result); - } - } - - return result; -}; - -SPOCK.callback = function(proc) { - return function() { - var args = Array.prototype.slice.call(arguments); - args.unshift(proc); - return SPOCK.run.apply(this, args); - }; -}; - -SPOCK.callbackMethod = function(proc) { - var g = this; - return function() { - var args = Array.prototype.slice.call(arguments); - args.unshift(this); - args.unshift(proc); - return SPOCK.run.apply(g, args); - }; -}; - -SPOCK.go = function(proc) { - (SPOCK.callback(proc))(); -}; - -if("java" in this) { // rhino - SPOCK.makeJavaInputPort = function(jp) { - return new SPOCK.Port("input", { - read: function(n) { - var buffer = ""; - - while(n--) { - var b = jp.read(); - - if(b === -1) break; - else buffer += String.fromCharCode(b); - } - - return buffer === "" ? SPOCK.EOF : buffer; - }, - - close: function() { jp.close(); } - }); - }; - - SPOCK.makeJavaOutputPort = function(jp) { - return new SPOCK.Port("output", { - write: function(s) { - var len = s.length; - - for(var i = 0; i < len; ++i) - jp.write(s.charCodeAt(i)); - }, - - flush: function() { jp.flush(); }, - close: function() { jp.close(); } - }); - }; - - SPOCK.log = function() { - java.lang.System.err.println(Array.prototype.slice.call(arguments).join("")); - }; - - SPOCK.stdin = SPOCK.makeJavaInputPort(java.lang.System[ "in" ]); - SPOCK.stdout = SPOCK.makeJavaOutputPort(java.lang.System.out); - SPOCK.stderr = SPOCK.makeJavaOutputPort(java.lang.System.err); - SPOCK.stderr.name = "[stderr]"; -} -else { - if("console" in this) SPOCK.log = console.log; // firebug - else if(SPOCK.inBrowser) // inside browser - SPOCK.log = function() { - var msg = arguments.join(" "); - - if(msg.charAt(msg.length - 1) == "\n") - msg = msg.substring(0, msg.length - 1); - - this.defaultStatus = msg; - }; - else if("print" in this) SPOCK.log = print; // spidermonkey/v8 - else if(typeof process !== undefined) SPOCK.log = console.log; // Node.JS - else SPOCK.error("no suitable output primitive available"); - - (function() { - var buffer = []; - - function flush() { - if(buffer.length > 0) { - SPOCK.log(buffer.join("")); - buffer = []; - } - } - - function write(s) { - var parts = SPOCK.stringify(s, false).split("\n"); - var len = parts.length - 1; - - if(len > 0) { // contains newline? - buffer.push(parts[ 0 ]); - flush(); - - if(len > 1) { - for(var i = 1; i < len; ++i) - SPOCK.log(parts[ i ]); - } - - buffer.push(parts[ len ]); - } - else buffer.push(parts[ 0 ]); - } - - SPOCK.stdout = new SPOCK.Port("output", { write: write, flush: flush }); - var inp; - var ibuffer = ""; - - if(this.prompt) { - inp = function(n) { - while(true) { - if(ibuffer.length <= n) { - var part = ibuffer.slice(0, n); - ibuffer = ibuffer.slice(n); - return part; - } - - var input = prompt("Expecting input for " + this.toString()); - - if(input === null) return SPOCK.EOF; - else ibuffer += input; - } - }; - } - else { - inp = function(n) { - SPOCK.error("no input possible for standard input port"); - }; - } - - SPOCK.stdin = new SPOCK.Port("input", { read: inp }); - SPOCK.stderr = SPOCK.stdout; - })(); -} - -SPOCK.stdin.name = "[stdin]"; -SPOCK.stdout.name = "[stdout]"; - -SPOCK.flush = function() { - // note that this always prints a newline when console.log or print is used - SPOCK.stdout.flush(); - - if(SPOCK.stderr !== SPOCK.stdout) - SPOCK.stderr.flush(); - - SPOCK.statistics(); -}; - -if(this.gc) SPOCK.gc = gc; -else SPOCK.gc = function() {}; - -SPOCK.openInputUrlHook = function(url) { - SPOCK.error("can not open", url); -}; - -SPOCK.openOutputUrlHook = function(url) { - SPOCK.error("can not open", url); -}; - -if("java" in this) { - SPOCK.openInputFile = function(filename) { - var stream; - - try { - stream = new java.io.FileInputStream(filename); - } - catch(e) { - SPOCK.error(e.message); - } - - var port = SPOCK.makeJavaInputPort(stream); - port.name = filename; - return port; - }; - - SPOCK.openOutputFile = function(filename) { - var stream; - - try { - stream = new java.io.FileOutputStream(filename); - } - catch(e) { - SPOCK.error(e.message); - } - - var port = SPOCK.makeJavaOutputPort(stream); - port.name = filename; - return port; - }; - - SPOCK.fileExists = function(filename) { - return (new java.io.File(filename)).exists(); - }; -} -else { - if(SPOCK.inBrowser) { - SPOCK.openInputFile = function(filename) { - if(filename.match(/^[a-z0-9]+:/)) - return SPOCK.openInputUrlHook(filename); - - var cookies = document.cookie.split("; "); - var buffer = null; - - for(var i = 0; i < cookies.length; ++i) { - var c = cookies[ i ]; - var p = c.indexOf("="); - - if(filename === c.substring(0, p)) { - buffer = c.substring(p + 1); - break; - } - } - - if(!buffer) SPOCK.error("can not open file", filename); - - var pos = 0; - - return new SPOCK.Port("input", { - read: function(n) { - if(pos >= buffer.length) return SPOCK.EOF; - else if(pos + len >= buffer.length) - return buffer.substring(pos); - - var p1 = pos; - pos += n; - return buffer.substring(p1, p1 + n); - }, - - ready: function() { return pos < buffer.length; } - }); - }; - - SPOCK.openOutputFile = function(filename, expiry) { - if(filename.match(/^[a-z0-9]+:/)) - return SPOCK.openOutputUrlHook(filename); - - return new SPOCK.Port("output", { - write: function(s) { buffer += s; }, - close: function() { - var now = (new Date()).getTime(); - var exp = now + (expiry || (1000 * 60 * 60 * 24 * 365)); - document.cookie = filename + "=" + encodeURIComponent(buffer) + - "; expires=" + (new Date(exp)).toGMTString(); - } - }); - }; - } - else { - SPOCK.openInputFile = function(filename) { - SPOCK.error("file-I/O not available"); - } - - SPOCK.openOutputFile = function(filename) { - SPOCK.error("file-I/O not available"); - } - } - - SPOCK.fileExists = function(filename) { - SPOCK.error("`file-exists?' not available"); - }; -} - -if("document" in this) { // browser? - SPOCK.load = function(url, k) { - // http://www.nczonline.net/blog/2009/07/28/the-best-way-to-load-external-javascript/ - var script = document.createElement("script") - - script.type = "text/javascript"; - k = k || function() {}; - - if (script.readyState){ //IE - script.onreadystatechange = function(){ - if (script.readyState == "loaded" || script.readyState == "complete"){ - script.onreadystatechange = null; - k(url); - } - }; - } - else { //Others - script.onload = function(){ - k(url); - }; - } - - script.src = url; - document.getElementsByTagName("head")[0].appendChild(script); - }; -} -else if("load" in this) { // rhino/SM - SPOCK.load = function(filename, k) { - load(filename); - - if(k) k(filename); - }; -} -/* CODE GENERATED BY SPOCK 0 */ -var t1350 = function (k1097) { - var t1351 = function (k1098, t1) { // %list - var t1 = SPOCK.rest(arguments, 1); - loop: while(true) { - return k1098(t1); - } - }; - ____25list = t1351; // set! %list - var t1353 = function(K) { - SPOCK.count(arguments, 'values'); - return K.apply(SPOCK.global, Array.prototype.slice.call(arguments, 1)); - }; - ___values = t1353; // set! values - var t1354 = function(K) { - SPOCK.count(arguments, 'call-with-values'); - var thunk = arguments[ 1 ]; - var proc = arguments[ 2 ]; - function k2() { - var args = Array.prototype.slice.call(arguments); - args.unshift(K); - return proc.apply(SPOCK.global, args);} - return thunk(k2); - }; - ___call_2dwith_2dvalues = t1354; // set! call-with-values - var t1355 = function(K) { - SPOCK.count(arguments, '%call-with-saved-values'); - var t1 = arguments[ 1 ]; - var t2 = arguments[ 2 ]; - var args; - function k2() { return K.apply(SPOCK.global, args); } - function k1() { - args = Array.prototype.slice.call(arguments); - return t2(k2);} - return t1(k1); - }; - ____25call_2dwith_2dsaved_2dvalues = t1355; // set! %call-with-saved-values - var t1356 = function (k1099, t2) { // list? - var r = SPOCK.count(arguments); - if(r) return r; - var t3 = undefined; - var t1357 = function (k1100, t4, t5) { // t3 - var r = SPOCK.count(arguments); - if(r) return r; - loop: while(true) { - var t1359 = null; - var t1358 = (t4) === (t1359); - var t6 = t1358; - var t1360; - if(t6 !== false) { - return k1100(t6); - } - else { - var t1362 = (t4) instanceof SPOCK.Pair ; - var t975 = t1362; - var t1363; - if(t975 !== false) { - var t1364 = t4.cdr; - var t11 = t1364; - var t1366 = null; - var t1365 = (t11) === (t1366); - var t13 = t1365; - var t1367; - if(t13 !== false) { - return k1100(t13); - } - else { - var t1369 = (t11) instanceof SPOCK.Pair ; - var t976 = t1369; - var t1370; - if(t976 !== false) { - var t1371 = t11.cdr; - var t18 = t1371; - var t1372 = t5.cdr; - var t19 = t1372; - var t1373 = (t18) === (t19); - var t22 = t1373; - var t1374; - if(t22 !== false) { - t1374 = false; - } - else { - t1374 = true; - } - var t977 = t1374; - var t1375; - if(t977 !== false) { - var t1376 = t18; - var t1377 = t19; - t4 = t1376; - t5 = t1377; - continue loop; - } - else { - return k1100(false); - } - t1370 = t1375; - } - else { - return k1100(false); - } - t1367 = t1370; - } - t1363 = t1367; - } - else { - return k1100(false); - } - t1360 = t1363; - } - } - }; - t3 = t1357; // set! t3 - return t3(k1099, t2, t2); - }; - ___list_3f = t1356; // set! list? - var t1382 = function (k1101, t25) { // caaar - var r = SPOCK.count(arguments); - if(r) return r; - loop: while(true) { - var t1383 = t25.car; - var t27 = t1383; - var t1384 = t27.car; - var t26 = t1384; - var t1385 = t26.car; - return k1101(t1385); - } - }; - ___caaar = t1382; // set! caaar - var t1387 = function (k1102, t32) { // caadr - var r = SPOCK.count(arguments); - if(r) return r; - loop: while(true) { - var t1388 = t32.cdr; - var t34 = t1388; - var t1389 = t34.car; - var t33 = t1389; - var t1390 = t33.car; - return k1102(t1390); - } - }; - ___caadr = t1387; // set! caadr - var t1392 = function (k1103, t39) { // cadar - var r = SPOCK.count(arguments); - if(r) return r; - loop: while(true) { - var t1393 = t39.car; - var t41 = t1393; - var t1394 = t41.cdr; - var t40 = t1394; - var t1395 = t40.car; - return k1103(t1395); - } - }; - ___cadar = t1392; // set! cadar - var t1397 = function (k1104, t46) { // caddr - var r = SPOCK.count(arguments); - if(r) return r; - loop: while(true) { - var t1398 = t46.cdr; - var t48 = t1398; - var t1399 = t48.cdr; - var t47 = t1399; - var t1400 = t47.car; - return k1104(t1400); - } - }; - ___caddr = t1397; // set! caddr - var t1402 = function (k1105, t53) { // cdaar - var r = SPOCK.count(arguments); - if(r) return r; - loop: while(true) { - var t1403 = t53.car; - var t55 = t1403; - var t1404 = t55.car; - var t54 = t1404; - var t1405 = t54.cdr; - return k1105(t1405); - } - }; - ___cdaar = t1402; // set! cdaar - var t1407 = function (k1106, t60) { // cdadr - var r = SPOCK.count(arguments); - if(r) return r; - loop: while(true) { - var t1408 = t60.cdr; - var t62 = t1408; - var t1409 = t62.car; - var t61 = t1409; - var t1410 = t61.cdr; - return k1106(t1410); - } - }; - ___cdadr = t1407; // set! cdadr - var t1412 = function (k1107, t67) { // cddar - var r = SPOCK.count(arguments); - if(r) return r; - loop: while(true) { - var t1413 = t67.car; - var t69 = t1413; - var t1414 = t69.cdr; - var t68 = t1414; - var t1415 = t68.cdr; - return k1107(t1415); - } - }; - ___cddar = t1412; // set! cddar - var t1417 = function (k1108, t74) { // cdddr - var r = SPOCK.count(arguments); - if(r) return r; - loop: while(true) { - var t1418 = t74.cdr; - var t76 = t1418; - var t1419 = t76.cdr; - var t75 = t1419; - var t1420 = t75.cdr; - return k1108(t1420); - } - }; - ___cdddr = t1417; // set! cdddr - var t1422 = function (k1109, t81) { // caaaar - var r = SPOCK.count(arguments); - if(r) return r; - loop: while(true) { - var t1423 = t81.car; - var t84 = t1423; - var t1424 = t84.car; - var t83 = t1424; - var t1425 = t83.car; - var t82 = t1425; - var t1426 = t82.car; - return k1109(t1426); - } - }; - ___caaaar = t1422; // set! caaaar - var t1428 = function (k1110, t90) { // caaadr - var r = SPOCK.count(arguments); - if(r) return r; - loop: while(true) { - var t1429 = t90.cdr; - var t93 = t1429; - var t1430 = t93.car; - var t92 = t1430; - var t1431 = t92.car; - var t91 = t1431; - var t1432 = t91.car; - return k1110(t1432); - } - }; - ___caaadr = t1428; // set! caaadr - var t1434 = function (k1111, t99) { // caadar - var r = SPOCK.count(arguments); - if(r) return r; - loop: while(true) { - var t1435 = t99.car; - var t102 = t1435; - var t1436 = t102.cdr; - var t101 = t1436; - var t1437 = t101.car; - var t100 = t1437; - var t1438 = t100.car; - return k1111(t1438); - } - }; - ___caadar = t1434; // set! caadar - var t1440 = function (k1112, t108) { // caaddr - var r = SPOCK.count(arguments); - if(r) return r; - loop: while(true) { - var t1441 = t108.cdr; - var t111 = t1441; - var t1442 = t111.cdr; - var t110 = t1442; - var t1443 = t110.car; - var t109 = t1443; - var t1444 = t109.car; - return k1112(t1444); - } - }; - ___caaddr = t1440; // set! caaddr - var t1446 = function (k1113, t117) { // cadaar - var r = SPOCK.count(arguments); - if(r) return r; - loop: while(true) { - var t1447 = t117.car; - var t120 = t1447; - var t1448 = t120.car; - var t119 = t1448; - var t1449 = t119.cdr; - var t118 = t1449; - var t1450 = t118.car; - return k1113(t1450); - } - }; - ___cadaar = t1446; // set! cadaar - var t1452 = function (k1114, t126) { // cadadr - var r = SPOCK.count(arguments); - if(r) return r; - loop: while(true) { - var t1453 = t126.cdr; - var t129 = t1453; - var t1454 = t129.car; - var t128 = t1454; - var t1455 = t128.cdr; - var t127 = t1455; - var t1456 = t127.car; - return k1114(t1456); - } - }; - ___cadadr = t1452; // set! cadadr - var t1458 = function (k1115, t135) { // caddar - var r = SPOCK.count(arguments); - if(r) return r; - loop: while(true) { - var t1459 = t135.car; - var t138 = t1459; - var t1460 = t138.cdr; - var t137 = t1460; - var t1461 = t137.cdr; - var t136 = t1461; - var t1462 = t136.car; - return k1115(t1462); - } - }; - ___caddar = t1458; // set! caddar - var t1464 = function (k1116, t144) { // cadddr - var r = SPOCK.count(arguments); - if(r) return r; - loop: while(true) { - var t1465 = t144.cdr; - var t147 = t1465; - var t1466 = t147.cdr; - var t146 = t1466; - var t1467 = t146.cdr; - var t145 = t1467; - var t1468 = t145.car; - return k1116(t1468); - } - }; - ___cadddr = t1464; // set! cadddr - var t1470 = function (k1117, t153) { // cdaaar - var r = SPOCK.count(arguments); - if(r) return r; - loop: while(true) { - var t1471 = t153.car; - var t156 = t1471; - var t1472 = t156.car; - var t155 = t1472; - var t1473 = t155.car; - var t154 = t1473; - var t1474 = t154.cdr; - return k1117(t1474); - } - }; - ___cdaaar = t1470; // set! cdaaar - var t1476 = function (k1118, t162) { // cdaadr - var r = SPOCK.count(arguments); - if(r) return r; - loop: while(true) { - var t1477 = t162.cdr; - var t165 = t1477; - var t1478 = t165.car; - var t164 = t1478; - var t1479 = t164.car; - var t163 = t1479; - var t1480 = t163.cdr; - return k1118(t1480); - } - }; - ___cdaadr = t1476; // set! cdaadr - var t1482 = function (k1119, t171) { // cdadar - var r = SPOCK.count(arguments); - if(r) return r; - loop: while(true) { - var t1483 = t171.car; - var t174 = t1483; - var t1484 = t174.cdr; - var t173 = t1484; - var t1485 = t173.car; - var t172 = t1485; - var t1486 = t172.cdr; - return k1119(t1486); - } - }; - ___cdadar = t1482; // set! cdadar - var t1488 = function (k1120, t180) { // cdaddr - var r = SPOCK.count(arguments); - if(r) return r; - loop: while(true) { - var t1489 = t180.cdr; - var t183 = t1489; - var t1490 = t183.cdr; - var t182 = t1490; - var t1491 = t182.car; - var t181 = t1491; - var t1492 = t181.cdr; - return k1120(t1492); - } - }; - ___cdaddr = t1488; // set! cdaddr - var t1494 = function (k1121, t189) { // cddaar - var r = SPOCK.count(arguments); - if(r) return r; - loop: while(true) { - var t1495 = t189.car; - var t192 = t1495; - var t1496 = t192.car; - var t191 = t1496; - var t1497 = t191.cdr; - var t190 = t1497; - var t1498 = t190.cdr; - return k1121(t1498); - } - }; - ___cddaar = t1494; // set! cddaar - var t1500 = function (k1122, t198) { // cddadr - var r = SPOCK.count(arguments); - if(r) return r; - loop: while(true) { - var t1501 = t198.cdr; - var t201 = t1501; - var t1502 = t201.car; - var t200 = t1502; - var t1503 = t200.cdr; - var t199 = t1503; - var t1504 = t199.cdr; - return k1122(t1504); - } - }; - ___cddadr = t1500; // set! cddadr - var t1506 = function (k1123, t207) { // cdddar - var r = SPOCK.count(arguments); - if(r) return r; - loop: while(true) { - var t1507 = t207.car; - var t210 = t1507; - var t1508 = t210.cdr; - var t209 = t1508; - var t1509 = t209.cdr; - var t208 = t1509; - var t1510 = t208.cdr; - return k1123(t1510); - } - }; - ___cdddar = t1506; // set! cdddar - var t1512 = function (k1124, t216) { // cddddr - var r = SPOCK.count(arguments); - if(r) return r; - loop: while(true) { - var t1513 = t216.cdr; - var t219 = t1513; - var t1514 = t219.cdr; - var t218 = t1514; - var t1515 = t218.cdr; - var t217 = t1515; - var t1516 = t217.cdr; - return k1124(t1516); - } - }; - ___cddddr = t1512; // set! cddddr - var t1518 = function (k1125, t225) { // append - var t225 = SPOCK.rest(arguments, 1); - var t1520 = null; - var t1519 = (t225) === (t1520); - var t978 = t1519; - var t1521; - if(t978 !== false) { - var t1522 = null; - return k1125(t1522); - } - else { - var t229 = undefined; - var t1524 = function (k1126, t230) { // t229 - var r = SPOCK.count(arguments); - if(r) return r; - var t1525 = t230.cdr; - var t231 = t1525; - var t1527 = null; - var t1526 = (t231) === (t1527); - var t979 = t1526; - var t1528; - if(t979 !== false) { - var t1529 = t230.car; - return k1126(t1529); - } - else { - var t236 = undefined; - var t1531 = function (k1127, t237) { // t236 - var r = SPOCK.count(arguments); - if(r) return r; - var t1532 = (t237) instanceof SPOCK.Pair ; - var t980 = t1532; - var t1533; - if(t980 !== false) { - var t1534 = t237.car; - var t239 = t1534; - var t1535 = function (t1128) { - var t240 = t1128; - var t1536 = new SPOCK.Pair(t239, t240); - return k1127(t1536); - }; - var t1538 = t237.cdr; - return t236(t1535, t1538); - } - else { - var t243 = t230; - var t1540 = t243.cdr; - return t229(k1127, t1540); - } - }; - t236 = t1531; // set! t236 - var t1542 = t230.car; - return t236(k1126, t1542); - } - }; - t229 = t1524; // set! t229 - return t229(k1125, t225); - } - }; - ___append = t1518; // set! append - var t1545 = function (k1129, t245) { // reverse - var r = SPOCK.count(arguments); - if(r) return r; - var t246 = undefined; - var t1546 = function (k1130, t247, t248) { // t246 - var r = SPOCK.count(arguments); - if(r) return r; - loop: while(true) { - var t1547 = (t247) instanceof SPOCK.Pair ; - var t981 = t1547; - var t1548; - if(t981 !== false) { - var t1551 = t247.cdr; - var t1549 = t1551; - var t1552 = t247.car; - var t251 = t1552; - var t1553 = new SPOCK.Pair(t251, t248); - var t1550 = t1553; - t247 = t1549; - t248 = t1550; - continue loop; - } - else { - return k1130(t248); - } - } - }; - t246 = t1546; // set! t246 - var t1555 = null; - return t246(k1129, t245, t1555); - }; - ___reverse = t1545; // set! reverse - var t1557 = function (k1131, t254, t255) { // list-tail - var r = SPOCK.count(arguments); - if(r) return r; - var t256 = undefined; - var t1558 = function (k1132, t257, t258) { // t256 - var r = SPOCK.count(arguments); - if(r) return r; - loop: while(true) { - var t1560 = (t257) <= 0 ; - var t1559; - if(t1560 !== false) { - return k1132(t258); - } - else { - var t1564 = (t257) - 1 ; - var t1562 = t1564; - var t1565 = t258.cdr; - var t1563 = t1565; - t257 = t1562; - t258 = t1563; - continue loop; - } - } - }; - t256 = t1558; // set! t256 - return t256(k1131, t255, t254); - }; - ___list_2dtail = t1557; // set! list-tail - var t260 = ___list_2dtail; - var t1567 = function (k1133, t261, t262) { // t260 - var r = SPOCK.count(arguments); - if(r) return r; - var t1568 = function (t1134) { - var t263 = t1134; - var t1569 = t263.car; - return k1133(t1569); - }; - return t260(t1568, t261, t262); - }; - ___list_2dref = t1567; // set! list-ref - var t1572 = function(K) { - SPOCK.count(arguments, 'memq'); - var x = arguments[ 1 ]; - for(var n = arguments[ 2 ]; n instanceof SPOCK.Pair; n = n.cdr) { - if(n.car === x) return K(n); - } - return K(false); - }; - ___memq = t1572; // set! memq - var t1573 = function(K) { - SPOCK.count(arguments, 'memv'); - var x = arguments[ 1 ]; - for(var n = arguments[ 2 ]; n instanceof SPOCK.Pair; n = n.cdr) { - if(SPOCK.eqvp(n.car, x)) return K(n); - } - return K(false); - }; - ___memv = t1573; // set! memv - var t1574 = function(K) { - SPOCK.count(arguments, 'member'); - var x = arguments[ 1 ]; - for(var n = arguments[ 2 ]; n instanceof SPOCK.Pair; n = n.cdr) { - if(SPOCK.equalp(n.car, x)) return K(n); - } - return K(false); - }; - ___member = t1574; // set! member - var t1575 = function(K) { - SPOCK.count(arguments, 'assq'); - var x = arguments[ 1 ]; - for(var n = arguments[ 2 ]; n instanceof SPOCK.Pair; n = n.cdr) { - var p = n.car; - if(p instanceof SPOCK.Pair && p.car === x) return K(p); - } - return K(false); - }; - ___assq = t1575; // set! assq - var t1576 = function(K) { - SPOCK.count(arguments, 'assv'); - var x = arguments[ 1 ]; - for(var n = arguments[ 2 ]; n instanceof SPOCK.Pair; n = n.cdr) { - var p = n.car; - if(p instanceof SPOCK.Pair && SPOCK.eqvp(p.car, x)) return K(p); - } - return K(false); - }; - ___assv = t1576; // set! assv - var t1577 = function(K) { - SPOCK.count(arguments, 'assoc'); - var x = arguments[ 1 ]; - for(var n = arguments[ 2 ]; n instanceof SPOCK.Pair; n = n.cdr) { - var p = n.car; - if(p instanceof SPOCK.Pair && SPOCK.equalp(p.car, x)) return K(p); - } - return K(false); - }; - ___assoc = t1577; // set! assoc - var t1578 = function(K) { - SPOCK.count(arguments, '%+'); - var len = arguments.length; - switch(len) { - case 1: return K(0); - case 2: return K(arguments[ 1 ]); - default: - var p = arguments[ 1 ]; - for(var i = 2; i < len; ++i) { - p += arguments[ i ]; - } - return K(p);} - }; - ____25_2b = t1578; // set! %+ - var t1579 = function(K) { - SPOCK.count(arguments, '%-'); - var len = arguments.length; - switch(len) { - case 2: return K(-arguments[ 1 ]); - default: - var p = arguments[ 1 ]; - for(var i = 2; i < len; ++i) { - p -= arguments[ i ]; - } - return K(p);} - }; - ____25_2d = t1579; // set! %- - var t1580 = function(K) { - SPOCK.count(arguments, '%*'); - var len = arguments.length; - switch(len) { - case 1: return K(1); - case 2: return K(arguments[ 1 ]); - default: - var p = arguments[ 1 ]; - for(var i = 2; i < len; ++i) { - p *= arguments[ i ]; - } - return K(p);} - }; - ____25_2a = t1580; // set! %* - var t1581 = function(K) { - SPOCK.count(arguments, '%/'); - var len = arguments.length; - switch(len) { - case 2: return K(1/arguments[ 1 ]); - default: - var p = arguments[ 1 ]; - for(var i = 2; i < len; ++i) { - p /= arguments[ i ]; - } - return K(p);} - }; - ____25_2f = t1581; // set! %/ - var t1582 = function(K) { - SPOCK.count(arguments, '%='); - var argc = arguments.length; - var last = SPOCK.check(arguments[ 1 ], 'number', '='); - for(var i = 2; i < argc; ++i) { - var x = SPOCK.check(arguments[ i ], 'number', '='); - if(last !== x) return K(false); - else last = x;} - return K(true); - }; - ____25_3d = t1582; // set! %= - var t1583 = function(K) { - SPOCK.count(arguments, '%>'); - var argc = arguments.length; - var last = SPOCK.check(arguments[ 1 ], 'number', '>'); - for(var i = 2; i < argc; ++i) { - var x = SPOCK.check(arguments[ i ], 'number', '>'); - if(last <= x) return K(false); - else last = x;} - return K(true); - }; - ____25_3e = t1583; // set! %> - var t1584 = function(K) { - SPOCK.count(arguments, '%<'); - var argc = arguments.length; - var last = SPOCK.check(arguments[ 1 ], 'number', '<'); - for(var i = 2; i < argc; ++i) { - var x = SPOCK.check(arguments[ i ], 'number', '<'); - if(last >= x) return K(false); - else last = x;} - return K(true); - }; - ____25_3c = t1584; // set! %< - var t1585 = function(K) { - SPOCK.count(arguments, '%>='); - var argc = arguments.length; - var last = SPOCK.check(arguments[ 1 ], 'number', '>='); - for(var i = 2; i < argc; ++i) { - var x = SPOCK.check(arguments[ i ], 'number', '>='); - if(last < x) return K(false); - else last = x;} - return K(true); - }; - ____25_3e_3d = t1585; // set! %>= - var t1586 = function(K) { - SPOCK.count(arguments, '%<='); - var argc = arguments.length; - var last = SPOCK.check(arguments[ 1 ], 'number', '<='); - for(var i = 2; i < argc; ++i) { - var x = SPOCK.check(arguments[ i ], 'number', '<='); - if(last > x) return K(false); - else last = x;} - return K(true); - }; - ____25_3c_3d = t1586; // set! %<= - var t1587 = function(K) { - SPOCK.count(arguments, '%max'); - return K(Math.max.apply(SPOCK.global, arguments)); - }; - ____25max = t1587; // set! %max - var t1588 = function(K) { - SPOCK.count(arguments, '%max'); - return K(Math.min.apply(SPOCK.global, arguments)); - }; - ____25max = t1588; // set! %max - var t1589 = function (k1135, t264, t265) { // modulo - var r = SPOCK.count(arguments); - if(r) return r; - loop: while(true) { - var t1590 = (t264) / (t265); - var t275 = t1590; - var t1592 = (t275) < 0 ; - var t1591; - if(t1592 !== false) { - var t1593 = Math.ceil(t275); - t1591 = t1593; - } - else { - var t1594 = Math.floor(t275); - t1591 = t1594; - } - var t271 = t1591; - var t1595 = (t271) * (t265); - var t270 = t1595; - var t1596 = (t264) - (t270); - var t266 = t1596; - var t1597 = (t265) < (0); - var t982 = t1597; - var t1598; - if(t982 !== false) { - var t1599 = (t266) <= (0); - var t983 = t1599; - var t1600; - if(t983 !== false) { - t1600 = t266; - } - else { - var t1601 = (t266) + (t265); - t1600 = t1601; - } - t1598 = t1600; - } - else { - var t1602 = (t266) >= (0); - var t984 = t1602; - var t1603; - if(t984 !== false) { - t1603 = t266; - } - else { - var t1604 = (t266) + (t265); - t1603 = t1604; - } - t1598 = t1603; - } - return k1135(t1598); - } - }; - ___modulo = t1589; // set! modulo - var t1606 = function (k1136, t289, t290) { // t288 - var r = SPOCK.count(arguments); - if(r) return r; - loop: while(true) { - var t1607 = (t289) / (t290); - var t297 = t1607; - var t1609 = (t297) < 0 ; - var t1608; - if(t1609 !== false) { - var t1610 = Math.ceil(t297); - t1608 = t1610; - } - else { - var t1611 = Math.floor(t297); - t1608 = t1611; - } - var t293 = t1608; - var t1612 = (t293) * (t290); - var t292 = t1612; - var t1613 = (t289) - (t292); - return k1136(t1613); - } - }; - var t288 = t1606; - var t1615 = function (k1137, t300, t301) { // t288 - var r = SPOCK.count(arguments); - if(r) return r; - var t302 = undefined; - var t1616 = function (k1138, t303, t304) { // t302 - var r = SPOCK.count(arguments); - if(r) return r; - var t1617 = (0) === (t304); - var t985 = t1617; - var t1618; - if(t985 !== false) { - var t1619 = Math.abs(t303); - return k1138(t1619); - } - else { - var t1621 = function (t1139) { - return t302(k1138, t304, t1139); - }; - return t288(t1621, t303, t304); - } - }; - t302 = t1616; // set! t302 - return t302(k1137, t300, t301); - }; - ____25gcd = t1615; // set! %gcd - var t1625 = function (k1140, t309) { // gcd - var t309 = SPOCK.rest(arguments, 1); - var t1627 = null; - var t1626 = (t309) === (t1627); - var t986 = t1626; - var t1628; - if(t986 !== false) { - return k1140(0); - } - else { - var t313 = undefined; - var t1630 = function (k1141, t314, t315) { // t313 - var r = SPOCK.count(arguments); - if(r) return r; - var t1631 = t314.car; - var t316 = t1631; - var t1632 = t314.cdr; - var t317 = t1632; - var t1634 = null; - var t1633 = (t317) === (t1634); - var t987 = t1633; - var t1635; - if(t987 !== false) { - var t1636 = Math.abs(t316); - return k1141(t1636); - } - else { - var t1638 = t317.car; - var t324 = t1638; - var t1639 = function (t1143) { - var t326 = t1143; - var t1640 = t317.cdr; - var t327 = t1640; - var t1641 = new SPOCK.Pair(t326, t327); - var t1142 = t1641; - return t313(k1141, t1142, false); - }; - return ____25gcd(t1639, t316, t324); - } - }; - t313 = t1630; // set! t313 - return t313(k1140, t309, true); - } - }; - ___gcd = t1625; // set! gcd - var t1645 = function (k1144, t329, t330) { // %lcm - var r = SPOCK.count(arguments); - if(r) return r; - var t1646 = (t329) * (t330); - var t331 = t1646; - var t1647 = function (t1145) { - var t332 = t1145; - var t1648 = (t331) / (t332); - var t335 = t1648; - var t1650 = (t335) < 0 ; - var t1649; - if(t1650 !== false) { - var t1651 = Math.ceil(t335); - t1649 = t1651; - } - else { - var t1652 = Math.floor(t335); - t1649 = t1652; - } - return k1144(t1649); - }; - return ____25gcd(t1647, t329, t330); - }; - ____25lcm = t1645; // set! %lcm - var t1655 = function (k1146, t338) { // lcm - var t338 = SPOCK.rest(arguments, 1); - var t1657 = null; - var t1656 = (t338) === (t1657); - var t988 = t1656; - var t1658; - if(t988 !== false) { - return k1146(1); - } - else { - var t342 = undefined; - var t1660 = function (k1147, t343, t344) { // t342 - var r = SPOCK.count(arguments); - if(r) return r; - var t1661 = t343.car; - var t345 = t1661; - var t1662 = t343.cdr; - var t346 = t1662; - var t1664 = null; - var t1663 = (t346) === (t1664); - var t989 = t1663; - var t1665; - if(t989 !== false) { - var t1666 = Math.abs(t345); - return k1147(t1666); - } - else { - var t1668 = t346.car; - var t353 = t1668; - var t1669 = function (t1149) { - var t355 = t1149; - var t1670 = t346.cdr; - var t356 = t1670; - var t1671 = new SPOCK.Pair(t355, t356); - var t1148 = t1671; - return t342(k1147, t1148, false); - }; - return ____25lcm(t1669, t345, t353); - } - }; - t342 = t1660; // set! t342 - return t342(k1146, t338, true); - } - }; - ___lcm = t1655; // set! lcm - var t1675 = function(K) { - SPOCK.count(arguments, 'string->symbol'); - var str = SPOCK.jstring(arguments[ 1 ]); - return K(SPOCK.intern(str)); - }; - ___string_2d_3esymbol = t1675; // set! string->symbol - var t1676 = function (k1150, t358, t359) { // get - var r = SPOCK.count(arguments); - if(r) return r; - loop: while(true) { - var t1678 = t359.name; - var t1677 = (t358) .plist[ (t1678) ] ; - var t360 = t1677; - var t1679 = t360 === undefined; - var t361 = t1679; - var t1680; - if(t361 !== false) { - t1680 = false; - } - else { - t1680 = true; - } - var t990 = t1680; - var t1681; - if(t990 !== false) { - t1681 = t360; - } - else { - t1681 = false; - } - return k1150(t1681); - } - }; - ___get = t1676; // set! get - var t1683 = function (k1151, t363, t364, t365) { // put! - var r = SPOCK.count(arguments); - if(r) return r; - loop: while(true) { - var t1685 = t364.name; - var t1684 = (t363) .plist[ (t1685) ] = (t365); - return k1151(t1684); - } - }; - ___put_21 = t1683; // set! put! - var t1687 = function(K) { - SPOCK.count(arguments, 'string-append'); - var args = Array.prototype.slice.call(arguments, 1); - var strs = SPOCK.map(function(x) { return SPOCK.jstring(x); }, args); - return K(new SPOCK.String(strs)); - }; - ___string_2dappend = t1687; // set! string-append - var t1688 = function(K) { - SPOCK.count(arguments, 'string'); - var str = []; - var len = arguments.length - 1; - for(var i = 1; i <= len; ++i) { - var x = arguments[ i ]; - if(x instanceof SPOCK.Char) str.push(x.character); - else SPOCK.error('bad argument type - not a character', x);} - return K(new SPOCK.String(str.join(''))); - }; - ___string = t1688; // set! string - var t1689 = function(K) { - SPOCK.count(arguments, 'string->list'); - var str = SPOCK.jstring(arguments[ 1 ]); - var lst = null; - var len = str.length; - for(var i = len - 1; i >= 0; --i) - lst = new SPOCK.Pair(new SPOCK.Char(str.charAt(i)), lst); - return K(lst); - }; - ___string_2d_3elist = t1689; // set! string->list - var t1690 = function(K) { - SPOCK.count(arguments, 'list->string'); - var lst = arguments[ 1 ]; - var str = []; - while(lst instanceof SPOCK.Pair) { - str.push(SPOCK.check(lst.car, SPOCK.Char).character); - lst = lst.cdr;} - return K(new SPOCK.String(str.join(''))); - }; - ___list_2d_3estring = t1690; // set! list->string - var t1691 = function(K) { - SPOCK.count(arguments, 'make-string'); - var n = SPOCK.check(arguments[ 1 ], 'number', 'make-string'); - var c = arguments[ 2 ]; - var a = new Array(n); - if(c !== undefined) - c = SPOCK.check(c, SPOCK.Char, 'make-string').character; - else c = ' '; - for(var i = 0; i < n; ++i) a[ i ] = c; - return K(new SPOCK.String(a.join(''))); - }; - ___make_2dstring = t1691; // set! make-string - var t1692 = function(K) { - SPOCK.count(arguments, 'string-ref'); - var str = arguments[ 1 ]; - var i = SPOCK.check(arguments[ 2 ], 'number', 'string-ref'); - if(typeof str === 'string') - return K(new SPOCK.Char(str.charAt(i))); - else if(str instanceof SPOCK.String) { - var parts = str.parts; - for(var p in parts) { - var l = parts[ p ].length; - if(i <= l) return K(new SPOCK.Char(parts[ p ].charAt(i))); - else i -= l;} - SPOCK.error('`string-ref\' out of range', str, i);} - }; - ___string_2dref = t1692; // set! string-ref - var t1693 = function(K) { - SPOCK.count(arguments, 'string-set!'); - var str = arguments[ 1 ]; - var i = SPOCK.check(arguments[ 2 ], 'number', 'string-set!'); - var c = SPOCK.check(arguments[ 3 ], SPOCK.Char, 'string-set!'); - if(typeof str === 'string') - SPOCK.error('argument to `string-set!\' is not a mutable string', str); - else if(str instanceof SPOCK.String) { - var parts = str.parts; - for(var p in parts) { - var part = parts[ p ]; - var l = part.length; - if(i <= l) { - parts[ p ] = part.substring(0, i) + c.character + part.substring(i + 1); - return K(undefined); - } else i -= l;} - SPOCK.error('`string-set!\' out of range', str, i);} - }; - ___string_2dset_21 = t1693; // set! string-set! - var t1694 = function (k1152, t366, t367, t368) { // string-copy - var r = SPOCK.count(arguments); - if(r) return r; - loop: while(true) { - var t1695 = SPOCK.jstring(t366); - var t369 = t1695; - var t1696 = t367 === undefined; - var t991 = t1696; - var t1697; - if(t991 !== false) { - t1697 = 0; - } - else { - t1697 = t367; - } - var t371 = t1697; - var t1698 = t368 === undefined; - var t992 = t1698; - var t1699; - if(t992 !== false) { - var t1700 = t369.length; - t1699 = t1700; - } - else { - t1699 = t368; - } - var t373 = t1699; - var t1701 = t369.slice(t371, t373); - var t375 = t1701; - var t1702 = new SPOCK.String(t375); - return k1152(t1702); - } - }; - ___string_2dcopy = t1694; // set! string-copy - var t1704 = function (k1153, t376, t377, t378, t379) { // string-fill! - var r = SPOCK.count(arguments); - if(r) return r; - var t1705; - if(true !== false) { - t1705 = false; - } - else { - t1705 = true; - } - var t993 = t1705; - var t1706 = function (t1154) { // t1155 - var t1707 = t376.normalize(); - var t381 = t1707; - var t382 = t377; - var t1708 = t378 === undefined; - var t994 = t1708; - var t1709; - if(t994 !== false) { - t1709 = 0; - } - else { - t1709 = t378; - } - var t383 = t1709; - var t1710 = t379 === undefined; - var t995 = t1710; - var t1711; - if(t995 !== false) { - var t1712 = t381.length; - t1711 = t1712; - } - else { - t1711 = t379; - } - var t385 = t1711; - var t1713 = function(K) { - SPOCK.count(arguments); - var str = arguments[ 1 ]; - var from = arguments[ 2 ]; - var to = arguments[ 3 ]; - var c = arguments[ 4 ]; - var snew = new Array(to - from); - for(var i in snew) snew[ i ] = c; - str.parts = [str.parts[ 0 ].substring(0, from), snew.join(''), - str.parts[ 0 ].substring(to)]; - return K(str); - }; - return t1713(k1153, t376, t383, t385, t382); - }; - var t1155 = t1706; - var t1715; - if(t993 !== false) { - return ____25error(t1155, "bad argument type - not a mutable string", t376); - } - else { - return t1155(undefined); - } - }; - ___string_2dfill_21 = t1704; // set! string-fill! - var t1718 = function(K) { - SPOCK.count(arguments, 'vector'); - return K(Array.prototype.slice.call(arguments, 1)); - }; - ___vector = t1718; // set! vector - var t1719 = function(K) { - SPOCK.count(arguments, 'make-vector'); - var n = SPOCK.check(arguments[ 1 ], 'number', 'make-vector'); - var x = arguments[ 2 ]; - var a = new Array(n); - if(x !== undefined) { - for(var i = 0; i < n; ++i) a[ i ] = x;} - return K(a); - }; - ___make_2dvector = t1719; // set! make-vector - var t1720 = function(K) { - SPOCK.count(arguments, 'vector->list'); - var vec = SPOCK.check(arguments[ 1 ], Array, 'vector->list'); - var lst = null; - var len = vec.length; - for(var i = len - 1; i >= 0; --i) - lst = new SPOCK.Pair(vec[ i ], lst); - return K(lst); - }; - ___vector_2d_3elist = t1720; // set! vector->list - var t1721 = function(K) { - SPOCK.count(arguments, 'list->vector'); - var lst = arguments[ 1 ]; - var vec = []; - while(lst instanceof SPOCK.Pair) { - vec.push(lst.car); - lst = lst.cdr;} - return K(vec); - }; - ___list_2d_3evector = t1721; // set! list->vector - var t1722 = function(K) { - SPOCK.count(arguments, 'vector-fill!'); - var vec = SPOCK.check(arguments[ 1 ], Array, 'vector-fill!'); - var x = arguments[ 2 ]; - var from = arguments[ 3 ]; - var to = arguments[ 4 ]; - if(from === undefined) from = 0; - if(to === undefined) to = vec.length; - for(var i = from; i < to; ++i) - vec[ i ] = x; - return K(undefined); - }; - ___vector_2dfill_21 = t1722; // set! vector-fill! - var t1723 = function(K) { - SPOCK.count(arguments, 'string->number'); - var str = SPOCK.jstring(arguments[ 1 ]); - var base = arguments[ 2 ]; - if(!base) base = 10; - else base = SPOCK.check(base, 'number', 'string->number'); - var m = true, neg = 1; - while(m) { - m = str.match(/^#[eboxid]/); - if(m) { - switch(str[ 1 ]) { - case 'e': - case 'i': break; - case 'd': base = 10; break; - case 'o': base = 8; break; - case 'x': base = 16; break; - case 'b': base = 2; break; - default: return K(false);} - str = str.substring(2);}} - switch(str[ 0 ]) { - case '-': neg = -1; str = str.substring(1); break; - case '+': str = str.substring(1);} - var num, den = false; - if((m = str.match(/^([^\/]+)\/(.+)$/))) { - str = m[ 1 ]; - den = m[ 2 ];} - function num3(s) { - var tr = null; - switch(base) { - case 2: tr = /^[0-1]+$/; break; - case 8: tr = /^[0-7]+$/; break; - case 10: tr = /^[#0-9]*\.?[#0-9]+([esdfl][-+]?[0-9]+)?$/; break; - case 16: tr = /^[0-9a-fA-F]+$/;} - if(tr && !s.match(tr)) return false; - var s2 = s.replace(/#/g, '0'); - if(base === 10) s2 = parseFloat(s2.replace(/[esdfl]/g, 'e')); - else if(s2 !== s) return false; - else s2 = parseInt(s2, base); - return isNaN(s2) ? false : s2;} - if((num = num3(str)) === false) return K(false); - if(den && !(den = num3(den))) return K(false); - return K(neg * num / (den || 1)); - }; - ___string_2d_3enumber = t1723; // set! string->number - var t1724 = function(K) { - SPOCK.count(arguments, '%show'); - arguments[ 2 ].write(arguments[ 1 ]); - return K(undefined); - }; - ____25show = t1724; // set! %show - var t1725 = function(K) { - SPOCK.count(arguments, '%fetch'); - return K(arguments[ 2 ].read(arguments[ 1 ])); - }; - ____25fetch = t1725; // set! %fetch - var t1726 = function (k1156, t387) { // newline - var r = SPOCK.count(arguments); - if(r) return r; - var t1727 = t387 === undefined; - var t996 = t1727; - var t1728; - if(t996 !== false) { - t1728 = SPOCK.stdout; - } - else { - t1728 = t387; - } - return ____25show(k1156, "\n", t1728); - }; - ___newline = t1726; // set! newline - var t1730 = function (k1157, t392) { // read-char - var r = SPOCK.count(arguments); - if(r) return r; - var t1731 = function (t1158) { - var t393 = t1158; - var t400 = SPOCK.EOF; - var t1732 = (t393) === (t400); - var t998 = t1732; - var t1733; - if(t998 !== false) { - t1733 = t393; - } - else { - var t1734 = new SPOCK.Char(t393); - t1733 = t1734; - } - return k1157(t1733); - }; - var t1736 = t392 === undefined; - var t997 = t1736; - var t1737; - if(t997 !== false) { - t1737 = SPOCK.stdin; - } - else { - t1737 = t392; - } - return ____25fetch(t1731, 1, t1737); - }; - ___read_2dchar = t1730; // set! read-char - var t1739 = function (k1159, t401, t402) { // write-char - var r = SPOCK.count(arguments); - if(r) return r; - var t1740 = t401.character; - var t1741 = t402 === undefined; - var t999 = t1741; - var t1742; - if(t999 !== false) { - t1742 = SPOCK.stdout; - } - else { - t1742 = t402; - } - return ____25show(k1159, t1740, t1742); - }; - ___write_2dchar = t1739; // set! write-char - var t407 = ___read_2dchar; - var t1744 = function (k1160, t408) { // t407 - var r = SPOCK.count(arguments); - if(r) return r; - var t1745 = function (t1161) { - var t409 = t1161; - var t413 = SPOCK.EOF; - var t1746 = (t409) === (t413); - var t410 = t1746; - var t1747; - if(t410 !== false) { - t1747 = false; - } - else { - t1747 = true; - } - var t1000 = t1747; - var t1748; - if(t1000 !== false) { - var t1750 = t409.character; - var t1749 = (t408) .peeked = (t1750); - t1748 = t1749; - } - else { - } - return k1160(t409); - }; - return t407(t1745, t408); - }; - ___peek_2dchar = t1744; // set! peek-char - var t1753 = function (k1162, t414) { // char-ready? - var r = SPOCK.count(arguments); - if(r) return r; - loop: while(true) { - var t1754 = t414.ready(); - return k1162(t1754); - } - }; - ___char_2dready_3f = t1753; // set! char-ready? - var t1756 = function (k1163, t418, t419, t420) { // %print-hook - var r = SPOCK.count(arguments); - if(r) return r; - return ____25show(k1163, "#<unknown object>", t419); - }; - ____25print_2dhook = t1756; // set! %print-hook - var t1758 = function (k1164, t421, t422) { // display - var r = SPOCK.count(arguments); - if(r) return r; - var t1759 = t422 === undefined; - var t1001 = t1759; - var t1760; - if(t1001 !== false) { - t1760 = SPOCK.stdout; - } - else { - t1760 = t422; - } - var t423 = t1760; - var t428 = undefined; - var t1761 = function (k1165, t429) { // t428 - var r = SPOCK.count(arguments); - if(r) return r; - var t1763 = null; - var t1762 = (t429) === (t1763); - var t1002 = t1762; - var t1764; - if(t1002 !== false) { - return ____25show(k1165, "()", t423); - } - else { - var t1766 = typeof(t429); - var t434 = t1766; - var t1767 = (t434) === ("number"); - var t1003 = t1767; - var t1768; - if(t1003 !== false) { - var t1771 = undefined === undefined; - var t1004 = t1771; - var t1772; - if(t1004 !== false) { - t1772 = 10; - } - else { - } - var t1770 = t429.toString(t1772); - var t1769 = new SPOCK.String(t1770); - var t436 = t1769; - var t1773 = SPOCK.jstring(t436); - return ____25show(k1165, t1773, t423); - } - else { - var t1775 = typeof(t429); - var t442 = t1775; - var t1776 = (t442) === ("string"); - var t441 = t1776; - var t1777; - if(t441 !== false) { - t1777 = t441; - } - else { - var t1778 = (t429) instanceof SPOCK.String ; - t1777 = t1778; - } - var t1005 = t1777; - var t1779; - if(t1005 !== false) { - var t1780 = SPOCK.jstring(t429); - return ____25show(k1165, t1780, t423); - } - else { - var t1782 = (t429) instanceof SPOCK.Symbol ; - var t1006 = t1782; - var t1783; - if(t1006 !== false) { - var t1784 = t429.name; - return ____25show(k1165, t1784, t423); - } - else { - var t1786 = (t429) instanceof SPOCK.Char ; - var t1007 = t1786; - var t1787; - if(t1007 !== false) { - var t1788 = t429.character; - return ____25show(k1165, t1788, t423); - } - else { - var t448 = SPOCK.EOF; - var t1790 = (t429) === (t448); - var t1008 = t1790; - var t1791; - if(t1008 !== false) { - return ____25show(k1165, "#<eof>", t423); - } - else { - var t1793 = typeof(t429); - var t450 = t1793; - var t1794 = (t450) === ("function"); - var t1009 = t1794; - var t1795; - if(t1009 !== false) { - return ____25show(k1165, "#<procedure>", t423); - } - else { - var t1797 = (t429) === (true); - var t453 = t1797; - var t1798; - if(t453 !== false) { - t1798 = t453; - } - else { - var t1799 = (t429) === (false); - t1798 = t1799; - } - var t1010 = t1798; - var t1800; - if(t1010 !== false) { - var t1801; - if(t429 !== false) { - t1801 = "#t"; - } - else { - t1801 = "#f"; - } - return ____25show(k1165, t1801, t423); - } - else { - var t1803 = (t429) instanceof SPOCK.Pair ; - var t1011 = t1803; - var t1804; - if(t1011 !== false) { - var t1805 = function (t1166) { - var t459 = undefined; - var t1806 = function (k1167, t460) { // t459 - var r = SPOCK.count(arguments); - if(r) return r; - var t1808 = null; - var t1807 = (t460) === (t1808); - var t1012 = t1807; - var t1809; - if(t1012 !== false) { - return ____25show(k1167, ")", t423); - } - else { - var t1811 = (t460) instanceof SPOCK.Pair ; - var t464 = t1811; - var t1812; - if(t464 !== false) { - t1812 = false; - } - else { - t1812 = true; - } - var t1013 = t1812; - var t1813; - if(t1013 !== false) { - var t1814 = function (t1168) { - var t1815 = function (t1169) { - return ____25show(k1167, ")", t423); - }; - return t428(t1815, t460); - }; - return ____25show(t1814, " . ", t423); - } - else { - var t467 = t429; - var t1819 = (t467) === (t460); - var t466 = t1819; - var t1820; - if(t466 !== false) { - t1820 = false; - } - else { - t1820 = true; - } - var t1014 = t1820; - var t1821 = function (t1170) { // t1172 - var t1822 = function (t1171) { - var t1823 = t460.cdr; - return t459(k1167, t1823); - }; - var t1825 = t460.car; - return t428(t1822, t1825); - }; - var t1172 = t1821; - var t1827; - if(t1014 !== false) { - return ____25show(t1172, " ", t423); - } - else { - return t1172(undefined); - } - t1813 = t1827; - } - t1809 = t1813; - } - }; - t459 = t1806; // set! t459 - return t459(k1165, t429); - }; - return ____25show(t1805, "(", t423); - } - else { - var t1832 = t429 === undefined; - var t1015 = t1832; - var t1833; - if(t1015 !== false) { - return ____25show(k1165, "#<undefined>", t423); - } - else { - var t1835 = (t429) instanceof Array ; - var t1016 = t1835; - var t1836; - if(t1016 !== false) { - var t1837 = t429.length; - var t474 = t1837; - var t1838 = function (t1173) { - var t475 = undefined; - var t1839 = function (k1174, t476) { // t475 - var r = SPOCK.count(arguments); - if(r) return r; - var t1841 = (t476) >= (t474); - var t1840; - if(t1841 !== false) { - return ____25show(k1174, ")", t423); - } - else { - var t1843 = (t476) === (0); - var t477 = t1843; - var t1844; - if(t477 !== false) { - t1844 = false; - } - else { - t1844 = true; - } - var t1017 = t1844; - var t1845 = function (t1175) { // t1177 - var t1846 = function (t1176) { - var t1847 = 1+ (t476); - return t475(k1174, t1847); - }; - var t1849 = (t429) [ (t476) ] ; - return t428(t1846, t1849); - }; - var t1177 = t1845; - var t1851; - if(t1017 !== false) { - return ____25show(t1177, " ", t423); - } - else { - return t1177(undefined); - } - t1840 = t1851; - } - }; - t475 = t1839; // set! t475 - return t475(k1165, 0); - }; - return ____25show(t1838, "#(", t423); - } - else { - var t1857 = (t429) instanceof SPOCK.Port ; - var t1856; - if(t1857 !== false) { - var t1858 = SPOCK.stringify(t429); - return ____25show(k1165, t1858, t423); - } - else { - var t1861 = (t429) instanceof SPOCK.Promise ; - var t1860; - if(t1861 !== false) { - return ____25show(k1165, "#<promise>", t423); - } - else { - var t1863 = typeof(t429); - var t481 = t1863; - var t1864 = ("object") === (t481); - var t1018 = t1864; - var t1865; - if(t1018 !== false) { - return ____25print_2dhook(k1165, t429, t423, false); - } - else { - return ____25show(k1165, "#<unknown object>", t423); - } - t1860 = t1865; - } - t1856 = t1860; - } - t1836 = t1856; - } - t1833 = t1836; - } - t1804 = t1833; - } - t1800 = t1804; - } - t1795 = t1800; - } - t1791 = t1795; - } - t1787 = t1791; - } - t1783 = t1787; - } - t1779 = t1783; - } - t1768 = t1779; - } - t1764 = t1768; - } - }; - t428 = t1761; // set! t428 - return t428(k1164, t421); - }; - ___display = t1758; // set! display - var t482 = ___display; - var t483 = undefined; - var t1869 = function(K) { - SPOCK.count(arguments, 't483'); - var str = arguments[ 1 ]; - var a = []; - var len = str.length; - for(var i = 0; i < len; ++i) { - var c = str.charAt(i); - switch(c) { - case '\n': a.push('\n'); break; - case '\t': a.push('\t'); break; - case '\r': a.push('\r'); break; - case '\"': a.push('\\"'); break; - case '\\': a.push('\\'); break; - default: a.push(c);}} - return K(a.join('')); - }; - t483 = t1869; // set! t483 - var t1870 = function (k1178, t484, t485) { - var r = SPOCK.count(arguments); - if(r) return r; - var t1871 = t485 === undefined; - var t1019 = t1871; - var t1872; - if(t1019 !== false) { - t1872 = SPOCK.stdout; - } - else { - t1872 = t485; - } - var t486 = t1872; - var t491 = undefined; - var t1873 = function (k1179, t492) { // t491 - var r = SPOCK.count(arguments); - if(r) return r; - var t1874 = typeof(t492); - var t495 = t1874; - var t1875 = (t495) === ("string"); - var t494 = t1875; - var t1876; - if(t494 !== false) { - t1876 = t494; - } - else { - var t1877 = (t492) instanceof SPOCK.String ; - t1876 = t1877; - } - var t1020 = t1876; - var t1878; - if(t1020 !== false) { - var t1879 = function (t1180) { - var t1880 = function (t1182) { - var t1881 = function (t1181) { - return ____25show(k1179, "\"", t486); - }; - return ____25show(t1881, t1182, t486); - }; - var t1884 = SPOCK.jstring(t492); - return t483(t1880, t1884); - }; - return ____25show(t1879, "\"", t486); - } - else { - var t1887 = (t492) instanceof SPOCK.Char ; - var t1021 = t1887; - var t1888; - if(t1021 !== false) { - var t1889 = function (t1183) { - var t1890 = t492.character; - var t498 = t1890; - var t1892 = SPOCK.eqvp(t498, "\n"); - var t1022 = t1892; - var t1893; - if(t1022 !== false) { - t1893 = true; - } - else { - t1893 = false; - } - var t1891; - if(t1893 !== false) { - t1891 = "newline"; - } - else { - var t1895 = SPOCK.eqvp(t498, "\r"); - var t1023 = t1895; - var t1896; - if(t1023 !== false) { - t1896 = true; - } - else { - t1896 = false; - } - var t1894; - if(t1896 !== false) { - t1894 = "return"; - } - else { - var t1898 = SPOCK.eqvp(t498, "\t"); - var t1024 = t1898; - var t1899; - if(t1024 !== false) { - t1899 = true; - } - else { - t1899 = false; - } - var t1897; - if(t1899 !== false) { - t1897 = "tab"; - } - else { - var t1901 = SPOCK.eqvp(t498, " "); - var t1025 = t1901; - var t1902; - if(t1025 !== false) { - t1902 = true; - } - else { - t1902 = false; - } - var t1900; - if(t1902 !== false) { - t1900 = "space"; - } - else { - t1900 = t498; - } - t1897 = t1900; - } - t1894 = t1897; - } - t1891 = t1894; - } - return ____25show(k1179, t1891, t486); - }; - return ____25show(t1889, "#\\", t486); - } - else { - var t1905 = (t492) instanceof SPOCK.Pair ; - var t1026 = t1905; - var t1906; - if(t1026 !== false) { - var t1907 = function (t1184) { - var t509 = undefined; - var t1908 = function (k1185, t510) { // t509 - var r = SPOCK.count(arguments); - if(r) return r; - var t1910 = null; - var t1909 = (t510) === (t1910); - var t1027 = t1909; - var t1911; - if(t1027 !== false) { - return ____25show(k1185, ")", t486); - } - else { - var t1913 = (t510) instanceof SPOCK.Pair ; - var t514 = t1913; - var t1914; - if(t514 !== false) { - t1914 = false; - } - else { - t1914 = true; - } - var t1028 = t1914; - var t1915; - if(t1028 !== false) { - var t1916 = function (t1186) { - var t1917 = function (t1187) { - return ____25show(k1185, ")", t486); - }; - return t491(t1917, t510); - }; - return ____25show(t1916, " . ", t486); - } - else { - var t517 = t492; - var t1921 = (t517) === (t510); - var t516 = t1921; - var t1922; - if(t516 !== false) { - t1922 = false; - } - else { - t1922 = true; - } - var t1029 = t1922; - var t1923 = function (t1188) { // t1190 - var t1924 = function (t1189) { - var t1925 = t510.cdr; - return t509(k1185, t1925); - }; - var t1927 = t510.car; - return t491(t1924, t1927); - }; - var t1190 = t1923; - var t1929; - if(t1029 !== false) { - return ____25show(t1190, " ", t486); - } - else { - return t1190(undefined); - } - t1915 = t1929; - } - t1911 = t1915; - } - }; - t509 = t1908; // set! t509 - return t509(k1179, t492); - }; - return ____25show(t1907, "(", t486); - } - else { - var t1934 = (t492) instanceof Array ; - var t1030 = t1934; - var t1935; - if(t1030 !== false) { - var t1936 = t492.length; - var t523 = t1936; - var t1937 = function (t1191) { - var t524 = undefined; - var t1938 = function (k1192, t525) { // t524 - var r = SPOCK.count(arguments); - if(r) return r; - var t1940 = (t525) >= (t523); - var t1939; - if(t1940 !== false) { - return ____25show(k1192, ")", t486); - } - else { - var t1942 = (t525) === (0); - var t526 = t1942; - var t1943; - if(t526 !== false) { - t1943 = false; - } - else { - t1943 = true; - } - var t1031 = t1943; - var t1944 = function (t1193) { // t1195 - var t1945 = function (t1194) { - var t1946 = 1+ (t525); - return t524(k1192, t1946); - }; - var t1948 = (t492) [ (t525) ] ; - return t491(t1945, t1948); - }; - var t1195 = t1944; - var t1950; - if(t1031 !== false) { - return ____25show(t1195, " ", t486); - } - else { - return t1195(undefined); - } - t1939 = t1950; - } - }; - t524 = t1938; // set! t524 - return t524(k1179, 0); - }; - return ____25show(t1937, "#(", t486); - } - else { - return t482(k1179, t492, t486); - } - t1906 = t1935; - } - t1888 = t1906; - } - t1878 = t1888; - } - }; - t491 = t1873; // set! t491 - return t491(k1178, t484); - }; - ___write = t1870; // set! write - var t1957 = function(K) { - SPOCK.count(arguments, 'apply'); - var proc = arguments[ 1 ]; - var argc = arguments.length; - var lst = arguments[ argc - 1 ]; - var vec = [K].concat(Array.prototype.slice.call(arguments, 2, argc - 1)); - if(lst instanceof Array) vec = vec.concat(lst); - else{ - var len = SPOCK.length(lst); - var vec2 = new Array(len); - for(var i = 0; lst instanceof SPOCK.Pair; lst = lst.cdr) - vec2[ i++ ] = lst.car; - vec = vec.concat(vec2);} - return proc.apply(SPOCK.global, vec); - }; - ___apply = t1957; // set! apply - var t1958 = function (k1196, t529, t530, t531) { // for-each - var r = SPOCK.count(arguments); - if(r) return r; - var t531 = SPOCK.rest(arguments, 3); - var t1960 = null; - var t1959 = (t531) === (t1960); - var t1032 = t1959; - var t1961; - if(t1032 !== false) { - var t1962 = (t530) instanceof Array ; - var t1033 = t1962; - var t1963; - if(t1033 !== false) { - var t1964 = t530.length; - var t536 = t1964; - var t538 = undefined; - var t1965 = function (k1197, t539) { // t538 - var r = SPOCK.count(arguments); - if(r) return r; - var t541 = t536; - var t1966 = (t539) >= (t541); - var t1034 = t1966; - var t1967; - if(t1034 !== false) { - return k1197(false); - } - else { - var t1969 = function (t1198) { - var t1970 = (t539) + (1); - return t538(k1197, t1970); - }; - var t542 = t530; - var t1972 = (t542) [ (t539) ] ; - return t529(t1969, t1972); - } - }; - t538 = t1965; // set! t538 - return t538(k1196, 0); - } - else { - var t546 = undefined; - var t1975 = function (k1199, t547) { // t546 - var r = SPOCK.count(arguments); - if(r) return r; - var t1976 = (t547) instanceof SPOCK.Pair ; - var t1035 = t1976; - var t1977; - if(t1035 !== false) { - var t1978 = function (t1200) { - var t1979 = t547.cdr; - return t546(k1199, t1979); - }; - var t1981 = t547.car; - return t529(t1978, t1981); - } - else { - return k1199(undefined); - } - }; - t546 = t1975; // set! t546 - return t546(k1196, t530); - } - t1961 = t1963; - } - else { - var t551 = undefined; - var t1985 = function (k1201, t552) { // t551 - var r = SPOCK.count(arguments); - if(r) return r; - var t554 = undefined; - var t1986 = function (k1207, t555) { // t554 - var r = SPOCK.count(arguments); - if(r) return r; - var t1988 = null; - var t1987 = (t555) === (t1988); - var t1036 = t1987; - var t1989; - if(t1036 !== false) { - var t1990 = null; - return k1207(t1990); - } - else { - var t1992 = t555.car; - var t559 = t1992; - var t1993 = (t559) instanceof SPOCK.Pair ; - var t1037 = t1993; - var t1994; - if(t1037 !== false) { - var t1995 = t559.car; - var t562 = t1995; - var t1996 = function (t1208) { - var t563 = t1208; - var t1997 = new SPOCK.Pair(t562, t563); - return k1207(t1997); - }; - var t1999 = t555.cdr; - return t554(t1996, t1999); - } - else { - return k1207(false); - } - t1989 = t1994; - } - }; - t554 = t1986; // set! t554 - var t2002 = function (t1202) { - var t553 = t1202; - var t2003; - if(t553 !== false) { - var t2004 = function (t1203) { - var t566 = undefined; - var t2005 = function (k1205, t567) { // t566 - var r = SPOCK.count(arguments); - if(r) return r; - var t2007 = null; - var t2006 = (t567) === (t2007); - var t1038 = t2006; - var t2008; - if(t1038 !== false) { - var t2009 = null; - return k1205(t2009); - } - else { - var t2011 = t567.car; - var t573 = t2011; - var t2012 = t573.cdr; - var t571 = t2012; - var t2013 = function (t1206) { - var t572 = t1206; - var t2014 = new SPOCK.Pair(t571, t572); - return k1205(t2014); - }; - var t2016 = t567.cdr; - return t566(t2013, t2016); - } - }; - t566 = t2005; // set! t566 - var t2018 = function (t1204) { - return t551(k1201, t1204); - }; - return t566(t2018, t552); - }; - return ___apply(t2004, t529, t553); - } - else { - return k1201(undefined); - } - }; - return t554(t2002, t552); - }; - t551 = t1985; // set! t551 - var t2024 = new SPOCK.Pair(t530, t531); - return t551(k1196, t2024); - } - }; - ___for_2deach = t1958; // set! for-each - var t2026 = function (k1209, t578, t579, t580) { // map - var r = SPOCK.count(arguments); - if(r) return r; - var t580 = SPOCK.rest(arguments, 3); - var t2028 = null; - var t2027 = (t580) === (t2028); - var t1039 = t2027; - var t2029; - if(t1039 !== false) { - var t2030 = (t579) instanceof Array ; - var t1040 = t2030; - var t2031; - if(t1040 !== false) { - var t2032 = t579.length; - var t585 = t2032; - var t2033 = function (t1210) { - var t587 = t1210; - var t588 = undefined; - var t2034 = function (k1211, t589) { // t588 - var r = SPOCK.count(arguments); - if(r) return r; - var t591 = t585; - var t2035 = (t589) >= (t591); - var t1041 = t2035; - var t2036; - if(t1041 !== false) { - return k1211(t587); - } - else { - var t592 = t587; - var t593 = t589; - var t2038 = function (t1213) { - var t594 = t1213; - var t2039 = (t592) [ (t593) ] = (t594); - var t1212 = t2039; - var t2040 = (t589) + (1); - return t588(k1211, t2040); - }; - var t595 = t579; - var t2042 = (t595) [ (t589) ] ; - return t578(t2038, t2042); - } - }; - t588 = t2034; // set! t588 - return t588(k1209, 0); - }; - return ___make_2dvector(t2033, t585); - } - else { - var t599 = undefined; - var t2046 = function (k1214, t600) { // t599 - var r = SPOCK.count(arguments); - if(r) return r; - var t2047 = (t600) instanceof SPOCK.Pair ; - var t1042 = t2047; - var t2048; - if(t1042 !== false) { - var t2049 = function (t1215) { - var t602 = t1215; - var t2050 = function (t1216) { - var t603 = t1216; - var t2051 = new SPOCK.Pair(t602, t603); - return k1214(t2051); - }; - var t2053 = t600.cdr; - return t599(t2050, t2053); - }; - var t2055 = t600.car; - return t578(t2049, t2055); - } - else { - var t2057 = null; - return k1214(t2057); - } - }; - t599 = t2046; // set! t599 - return t599(k1209, t579); - } - t2029 = t2031; - } - else { - var t606 = undefined; - var t2060 = function (k1217, t607) { // t606 - var r = SPOCK.count(arguments); - if(r) return r; - var t609 = undefined; - var t2061 = function (k1224, t610) { // t609 - var r = SPOCK.count(arguments); - if(r) return r; - var t2063 = null; - var t2062 = (t610) === (t2063); - var t1043 = t2062; - var t2064; - if(t1043 !== false) { - var t2065 = null; - return k1224(t2065); - } - else { - var t2067 = t610.car; - var t614 = t2067; - var t2068 = (t614) instanceof SPOCK.Pair ; - var t1044 = t2068; - var t2069; - if(t1044 !== false) { - var t2070 = t614.car; - var t617 = t2070; - var t2071 = function (t1225) { - var t618 = t1225; - var t2072 = new SPOCK.Pair(t617, t618); - return k1224(t2072); - }; - var t2074 = t610.cdr; - return t609(t2071, t2074); - } - else { - return k1224(false); - } - t2064 = t2069; - } - }; - t609 = t2061; // set! t609 - var t2077 = function (t1218) { - var t608 = t1218; - var t2078; - if(t608 !== false) { - var t2079 = function (t1219) { - var t621 = t1219; - var t623 = undefined; - var t2080 = function (k1222, t624) { // t623 - var r = SPOCK.count(arguments); - if(r) return r; - var t2082 = null; - var t2081 = (t624) === (t2082); - var t1045 = t2081; - var t2083; - if(t1045 !== false) { - var t2084 = null; - return k1222(t2084); - } - else { - var t2086 = t624.car; - var t630 = t2086; - var t2087 = t630.cdr; - var t628 = t2087; - var t2088 = function (t1223) { - var t629 = t1223; - var t2089 = new SPOCK.Pair(t628, t629); - return k1222(t2089); - }; - var t2091 = t624.cdr; - return t623(t2088, t2091); - } - }; - t623 = t2080; // set! t623 - var t2093 = function (t1221) { - var t2094 = function (t1220) { - var t622 = t1220; - var t2095 = new SPOCK.Pair(t621, t622); - return k1217(t2095); - }; - return t606(t2094, t1221); - }; - return t623(t2093, t607); - }; - return ___apply(t2079, t578, t608); - } - else { - var t2100 = null; - return k1217(t2100); - } - }; - return t609(t2077, t607); - }; - t606 = t2060; // set! t606 - var t2103 = new SPOCK.Pair(t579, t580); - return t606(k1209, t2103); - } - }; - ___map = t2026; // set! map - var t2105 = function (k1226, t637, t638, t639) { // dynamic-wind - var r = SPOCK.count(arguments); - if(r) return r; - var t2106 = function (t1227) { - var t2107 = new SPOCK.Pair(t637, t639); - var t640 = t2107; - var t641 = SPOCK.dynwinds; - var t2108 = new SPOCK.Pair(t640, t641); - SPOCK.dynwinds = t2108 - var t2109 = function (k1228) { - var t644 = SPOCK.dynwinds; - var t2110 = t644.cdr; - SPOCK.dynwinds = t2110 - return t639(k1228); - }; - return ____25call_2dwith_2dsaved_2dvalues(k1226, t638, t2109); - }; - return t637(t2106); - }; - ___dynamic_2dwind = t2105; // set! dynamic-wind - var t2114 = function(K) { - SPOCK.count(arguments, '%call-with-current-continuation'); - var proc = arguments[ 1 ]; - function cont() { - return K.apply(SPOCK.global, Array.prototype.slice.call(arguments, 1));} - return proc(K, cont); - }; - ____25call_2dwith_2dcurrent_2dcontinuation = t2114; // set! %call-with-current-continuation - var t645 = undefined; - var t2115 = function (k1229, t646, t647) { // t645 - var r = SPOCK.count(arguments); - if(r) return r; - var t649 = SPOCK.dynwinds; - var t2116 = (t649) === (t646); - var t648 = t2116; - var t2117; - if(t648 !== false) { - return k1229(t648); - } - else { - var t2119 = (t647) < (0); - var t1046 = t2119; - var t2120; - if(t1046 !== false) { - var t2121 = function (t1230) { - var t2122 = t646.car; - var t654 = t2122; - var t2123 = t654.car; - var t2124 = function (t1231) { - SPOCK.dynwinds = t646 - return k1229(undefined); - }; - return t2123(t2124); - }; - var t2127 = t646.cdr; - var t2128 = (t647) + 1 ; - return t645(t2121, t2127, t2128); - } - else { - var t658 = SPOCK.dynwinds; - var t2130 = t658.car; - var t657 = t2130; - var t2131 = t657.cdr; - var t656 = t2131; - var t659 = SPOCK.dynwinds; - var t2132 = t659.cdr; - SPOCK.dynwinds = t2132 - var t2133 = function (t1232) { - var t2134 = (t647) - 1 ; - return t645(k1229, t646, t2134); - }; - return t656(t2133); - } - t2117 = t2120; - } - }; - t645 = t2115; // set! t645 - var t2137 = function (k1233, t660) { - var r = SPOCK.count(arguments); - if(r) return r; - var t661 = SPOCK.dynwinds; - var t2138 = function (k1234, t662) { - var r = SPOCK.count(arguments); - if(r) return r; - var t2139 = function (k1235, t663) { - var t663 = SPOCK.rest(arguments, 1); - var t664 = SPOCK.dynwinds; - var t667 = t661; - var t2140 = (t664) === (t667); - var t665 = t2140; - var t2141; - if(t665 !== false) { - t2141 = false; - } - else { - t2141 = true; - } - var t1047 = t2141; - var t2142 = function (t1236) { // t1237 - return ___apply(k1235, t662, t663); - }; - var t1237 = t2142; - var t2144; - if(t1047 !== false) { - var t2145 = SPOCK.length(t664); - var t668 = t2145; - var t671 = t661; - var t2146 = SPOCK.length(t671); - var t669 = t2146; - var t2147 = (t668) - (t669); - return t645(t1237, t661, t2147); - } - else { - return t1237(undefined); - } - }; - return t660(k1234, t2139); - }; - return ____25call_2dwith_2dcurrent_2dcontinuation(k1233, t2138); - }; - ___call_2dwith_2dcurrent_2dcontinuation = t2137; // set! call-with-current-continuation - var t2152 = function (k1238, t672) { // %get-context - var r = SPOCK.count(arguments); - if(r) return r; - return ___vector(k1238, t672, SPOCK.dynwinds, SPOCK.stdin, SPOCK.stdout, SPOCK.stderr); - }; - ____25get_2dcontext = t2152; // set! %get-context - var t2154 = function(K) { - SPOCK.count(arguments, '%restore-context'); - var state = arguments[ 1 ]; - SPOCK.dynwinds = state[ 1 ]; - SPOCK.stdin = state[ 2 ]; - SPOCK.stdout = state[ 3 ]; - SPOCK.stderr = state[ 4 ]; - return (state[ 0 ])(undefined); - }; - ____25restore_2dcontext = t2154; // set! %restore-context - var t2155 = function (k1239, t673) { // suspend - var r = SPOCK.count(arguments); - if(r) return r; - var t2156 = function (k1240, t674) { - var r = SPOCK.count(arguments); - if(r) return r; - var t2157 = function (t1242) { - var t2158 = function (t1241) { - var t2159 = function(K) { - SPOCK.count(arguments); - return new SPOCK.Result(undefined); - }; - return t2159(k1240); - }; - return t673(t2158, t1242); - }; - return ____25get_2dcontext(t2157, t674); - }; - return ____25call_2dwith_2dcurrent_2dcontinuation(k1239, t2156); - }; - ___suspend = t2155; // set! suspend - var t2164 = function (k1243, t675) { // %make-promise - var r = SPOCK.count(arguments); - if(r) return r; - var t676 = false; - var t677 = false; - var t2166 = function (k1244) { // t677 - var t2167; - if(t676 !== false) { - return ___apply(k1244, ___values, t677); - } - else { - var t2169 = function (k1245, t678) { - var t678 = SPOCK.rest(arguments, 1); - var t2170; - if(t676 !== false) { - return ___apply(k1245, ___values, t677); - } - else { - t676 = true; // set! t676 - t677 = t678; // set! t677 - return ___apply(k1245, ___values, t677); - } - }; - return ___call_2dwith_2dvalues(k1244, t675, t2169); - } - }; - var t2165 = new SPOCK.Promise(t2166); - return k1243(t2165); - }; - ____25make_2dpromise = t2164; // set! %make-promise - var t2175 = function (k1246, t679) { // force - var r = SPOCK.count(arguments); - if(r) return r; - var t2177 = (t679) instanceof SPOCK.Promise ; - var t2176; - if(t2177 !== false) { - var t2178 = t679.thunk; - return t2178(k1246); - } - else { - return k1246(t679); - } - }; - ___force = t2175; // set! force - var t680 = ___dynamic_2dwind; - var t2181 = function (k1247, t681, t682) { // t680 - var r = SPOCK.count(arguments); - if(r) return r; - var t686 = false; - var t2182 = function (k1248) { - loop: while(true) { - t686 = SPOCK.stdin; // set! t686 - SPOCK.stdin = t681 - return k1248(undefined); - } - }; - var t2184 = function (k1249) { - loop: while(true) { - SPOCK.stdin = t686 - return k1249(undefined); - } - }; - return t680(k1247, t2182, t682, t2184); - }; - ___with_2dinput_2dfrom_2dport = t2181; // set! with-input-from-port - var t687 = ___dynamic_2dwind; - var t2187 = function (k1250, t688, t689) { // t687 - var r = SPOCK.count(arguments); - if(r) return r; - var t693 = false; - var t2188 = function (k1251) { - loop: while(true) { - t693 = SPOCK.stdout; // set! t693 - SPOCK.stdout = t688 - return k1251(undefined); - } - }; - var t2190 = function (k1252) { - loop: while(true) { - SPOCK.stdout = t693 - return k1252(undefined); - } - }; - return t687(k1250, t2188, t689, t2190); - }; - ___with_2doutput_2dto_2dport = t2187; // set! with-output-to-port - var t2193 = function(K) { - SPOCK.count(arguments, '%close-port'); - var port = arguments[ 1 ]; - port.close(); - port.closed = true; - return K(port); - }; - ____25close_2dport = t2193; // set! %close-port - var t2194 = function(K) { - SPOCK.count(arguments, 'open-input-file'); - var fn = SPOCK.check(arguments[ 1 ], 'string', 'open-input-file'); - return K(SPOCK.openInputFile(fn)); - }; - ___open_2dinput_2dfile = t2194; // set! open-input-file - var t2195 = function(K) { - SPOCK.count(arguments, 'open-output-file'); - var fn = SPOCK.check(arguments[ 1 ], 'string', 'open-input-file'); - var exp = null; - if(arguments.length === 3) - exp = SPOCK.check(arguments[ 2 ], 'number', 'open-input-file'); - return K(SPOCK.openOutputFile(fn, exp)); - }; - ___open_2doutput_2dfile = t2195; // set! open-output-file - var t2196 = function (k1253, t694) { // close-input-port - var r = SPOCK.count(arguments); - if(r) return r; - var t695 = t694; - return ____25close_2dport(k1253, t695); - }; - ___close_2dinput_2dport = t2196; // set! close-input-port - var t2198 = function (k1254, t699) { // close-output-port - var r = SPOCK.count(arguments); - if(r) return r; - var t700 = t699; - return ____25close_2dport(k1254, t700); - }; - ___close_2doutput_2dport = t2198; // set! close-output-port - var t705 = ___open_2dinput_2dfile; - var t2200 = function (k1255, t708, t709) { // t705 - var r = SPOCK.count(arguments); - if(r) return r; - var t2201 = function (t1256) { - var t710 = t1256; - var t2202 = function (k1257) { - return t709(k1257, t710); - }; - var t2204 = function (k1258) { - return ___close_2dinput_2dport(k1258, t710); - }; - return ____25call_2dwith_2dsaved_2dvalues(k1255, t2202, t2204); - }; - return t705(t2201, t708); - }; - ___call_2dwith_2dinput_2dfile = t2200; // set! call-with-input-file - var t712 = ___open_2doutput_2dfile; - var t2208 = function (k1259, t715, t716) { // t712 - var r = SPOCK.count(arguments); - if(r) return r; - var t2209 = function (t1260) { - var t717 = t1260; - var t2210 = function (k1261) { - return t716(k1261, t717); - }; - var t2212 = function (k1262) { - return ___close_2doutput_2dport(k1262, t717); - }; - return ____25call_2dwith_2dsaved_2dvalues(k1259, t2210, t2212); - }; - return t712(t2209, t715); - }; - ___call_2dwith_2doutput_2dfile = t2208; // set! call-with-output-file - var t718 = ___with_2dinput_2dfrom_2dport; - var t719 = ___open_2dinput_2dfile; - var t723 = ___close_2dinput_2dport; - var t2216 = function (k1263, t724, t725) { // t723 - var r = SPOCK.count(arguments); - if(r) return r; - var t2217 = function (t1264) { - var t726 = t1264; - var t2218 = function (k1265) { - var t2219 = function (k1266) { - return t723(k1266, t726); - }; - return ____25call_2dwith_2dsaved_2dvalues(k1265, t725, t2219); - }; - return t718(k1263, t726, t2218); - }; - return t719(t2217, t724); - }; - ___with_2dinput_2dfrom_2dfile = t2216; // set! with-input-from-file - var t727 = ___with_2doutput_2dto_2dport; - var t728 = ___open_2doutput_2dfile; - var t732 = ___close_2doutput_2dport; - var t2224 = function (k1267, t733, t734) { // t732 - var r = SPOCK.count(arguments); - if(r) return r; - var t2225 = function (t1268) { - var t735 = t1268; - var t2226 = function (k1269) { - var t2227 = function (k1270) { - return t732(k1270, t735); - }; - return ____25call_2dwith_2dsaved_2dvalues(k1269, t734, t2227); - }; - return t727(k1267, t735, t2226); - }; - return t728(t2225, t733); - }; - ___with_2doutput_2dto_2dfile = t2224; // set! with-output-to-file - var t2232 = function (k1271, t736) { // open-input-string - var r = SPOCK.count(arguments); - if(r) return r; - var t737 = undefined; - var t2233 = function(K) { - SPOCK.count(arguments, 't737'); - var buffer = arguments[ 1 ]; - var pos = 0; - var len = buffer.length; - function read(n) { - if(pos >= len) return SPOCK.EOF; - var str = buffer.substring(pos, pos + n); - pos += n; - return str;} - return K(new SPOCK.Port('input', { read: read })); - }; - t737 = t2233; // set! t737 - var t2234 = SPOCK.jstring(t736); - return t737(k1271, t2234); - }; - ___open_2dinput_2dstring = t2232; // set! open-input-string - var t2236 = function(K) { - SPOCK.count(arguments, 'open-output-string'); - var buffer = []; - function write(s) { buffer.push(s); } - var port = new SPOCK.Port('output', { write: write }); - port.buffer = buffer; - port.isStringPort = true; - return K(port); - }; - ___open_2doutput_2dstring = t2236; // set! open-output-string - var t2237 = function (k1272, t739) { // get-output-string - var r = SPOCK.count(arguments); - if(r) return r; - loop: while(true) { - var t2238 = t739.isStringPort; - var t742 = t2238; - var t2239 = t742 === undefined; - var t741 = t2239; - var t2240; - if(t741 !== false) { - t2240 = false; - } - else { - t2240 = true; - } - var t1048 = t2240; - var t2241; - if(t1048 !== false) { - var t2243 = t739.buffer; - var t2242 = t2243.join(""); - var t744 = t2242; - var t2244 = new SPOCK.String(t744); - var t743 = t2244; - var t2245 = (t739) .buffer = [] ; - t2241 = t743; - } - else { - var t2246 = SPOCK.error("bad argument type - not a string port", t739); - t2241 = t2246; - } - return k1272(t2241); - } - }; - ___get_2doutput_2dstring = t2237; // set! get-output-string - var t2248 = function (k1273, t745, t746) { // with-input-from-string - var r = SPOCK.count(arguments); - if(r) return r; - var t2249 = function (t1274) { - var t747 = t1274; - return ___with_2dinput_2dfrom_2dport(k1273, t747, t746); - }; - return ___open_2dinput_2dstring(t2249, t745); - }; - ___with_2dinput_2dfrom_2dstring = t2248; // set! with-input-from-string - var t2252 = function (k1275, t748) { // with-output-to-string - var r = SPOCK.count(arguments); - if(r) return r; - var t2253 = function (t1276) { - var t749 = t1276; - var t2254 = function (t1277) { - return ___get_2doutput_2dstring(k1275, t749); - }; - return ___with_2doutput_2dto_2dport(t2254, t749, t748); - }; - return ___open_2doutput_2dstring(t2253); - }; - ___with_2doutput_2dto_2dstring = t2252; // set! with-output-to-string - var t750 = ___read_2dchar; - var t751 = ___reverse; - var t752 = ___peek_2dchar; - var t753 = ___list_2d_3evector; - var t754 = ___list_2d_3estring; - var t2258 = function (k1278) { // t755 - loop: while(true) { - return k1278(SPOCK.stdin); - } - }; - var t755 = t2258; - var t756 = ___string_2d_3enumber; - var t2260 = function (k1279, t757) { // t756 - var r = SPOCK.count(arguments); - if(r) return r; - var t2261 = t757 === undefined; - var t1049 = t2261; - var t2262 = function (t1280) { // t1337 - var t758 = t1280; - var t760 = undefined; - var t761 = undefined; - var t762 = undefined; - var t763 = undefined; - var t764 = undefined; - var t765 = undefined; - var t766 = undefined; - var t767 = undefined; - var t2263 = function (k1281, t768) { // t760 - var r = SPOCK.count(arguments); - if(r) return r; - var t2264 = function (t1282) { - var t769 = t1282; - var t2265; - if(t769 !== false) { - return k1281(t769); - } - else { - return ___string_2d_3esymbol(k1281, t768); - } - }; - return t756(t2264, t768); - }; - t760 = t2263; // set! t760 - var t2269 = function (k1283) { // t761 - var t2270 = function (t1284) { - var t770 = t1284; - var t773 = SPOCK.EOF; - var t2271 = (t770) === (t773); - var t1050 = t2271; - var t2272; - if(t1050 !== false) { - return k1283(t770); - } - else { - var t774 = t770; - var t2276 = new SPOCK.Char("#"); - var t2275 = SPOCK.eqvp(t770, t2276); - var t1051 = t2275; - var t2277; - if(t1051 !== false) { - t2277 = true; - } - else { - t2277 = false; - } - var t2274; - if(t2277 !== false) { - return t764(k1283); - } - else { - var t2281 = new SPOCK.Char("("); - var t2280 = SPOCK.eqvp(t774, t2281); - var t1052 = t2280; - var t2282; - if(t1052 !== false) { - t2282 = true; - } - else { - t2282 = false; - } - var t2279; - if(t2282 !== false) { - var t2283 = new SPOCK.Char(")"); - return t765(k1283, t2283); - } - else { - var t2287 = new SPOCK.Char("["); - var t2286 = SPOCK.eqvp(t774, t2287); - var t1053 = t2286; - var t2288; - if(t1053 !== false) { - t2288 = true; - } - else { - t2288 = false; - } - var t2285; - if(t2288 !== false) { - var t2289 = new SPOCK.Char("]"); - return t765(k1283, t2289); - } - else { - var t2293 = new SPOCK.Char("{"); - var t2292 = SPOCK.eqvp(t774, t2293); - var t1054 = t2292; - var t2294; - if(t1054 !== false) { - t2294 = true; - } - else { - t2294 = false; - } - var t2291; - if(t2294 !== false) { - var t2295 = new SPOCK.Char("}"); - return t765(k1283, t2295); - } - else { - var t2299 = new SPOCK.Char(","); - var t2298 = SPOCK.eqvp(t774, t2299); - var t1055 = t2298; - var t2300; - if(t1055 !== false) { - t2300 = true; - } - else { - t2300 = false; - } - var t2297; - if(t2300 !== false) { - var t2301 = function (t1285) { - var t785 = t1285; - var t2303 = new SPOCK.Char("@"); - var t2302 = SPOCK.eqvp(t785, t2303); - var t1056 = t2302; - var t2304; - if(t1056 !== false) { - var t2305 = function (t1287) { - var t2306 = function (t1286) { - var t787 = t1286; - return k1283(t787); - }; - var t2308 = SPOCK.intern("unquote-splicing"); - return ____25list(t2306, t2308, t1287); - }; - return t761(t2305); - } - else { - var t2311 = function (t1289) { - var t2312 = function (t1288) { - var t788 = t1288; - return k1283(t788); - }; - var t2314 = SPOCK.intern("unquote"); - return ____25list(t2312, t2314, t1289); - }; - return t761(t2311); - } - }; - return t752(t2301, t758); - } - else { - var t2320 = new SPOCK.Char("`"); - var t2319 = SPOCK.eqvp(t774, t2320); - var t1057 = t2319; - var t2321; - if(t1057 !== false) { - t2321 = true; - } - else { - t2321 = false; - } - var t2318; - if(t2321 !== false) { - var t2322 = function (t1291) { - var t2323 = function (t1290) { - var t791 = t1290; - return k1283(t791); - }; - var t2325 = SPOCK.intern("quasiquote"); - return ____25list(t2323, t2325, t1291); - }; - return t761(t2322); - } - else { - var t2330 = new SPOCK.Char("'"); - var t2329 = SPOCK.eqvp(t774, t2330); - var t1058 = t2329; - var t2331; - if(t1058 !== false) { - t2331 = true; - } - else { - t2331 = false; - } - var t2328; - if(t2331 !== false) { - var t2332 = function (t1293) { - var t2333 = function (t1292) { - var t794 = t1292; - return k1283(t794); - }; - var t2335 = SPOCK.intern("quote"); - return ____25list(t2333, t2335, t1293); - }; - return t761(t2332); - } - else { - var t2340 = new SPOCK.Char(";"); - var t2339 = SPOCK.eqvp(t774, t2340); - var t1059 = t2339; - var t2341; - if(t1059 !== false) { - t2341 = true; - } - else { - t2341 = false; - } - var t2338; - if(t2341 !== false) { - var t2342 = function (t1294) { - return t761(k1283); - }; - return t762(t2342); - } - else { - var t2347 = new SPOCK.Char("\""); - var t2346 = SPOCK.eqvp(t774, t2347); - var t1060 = t2346; - var t2348; - if(t1060 !== false) { - t2348 = true; - } - else { - t2348 = false; - } - var t2345; - if(t2348 !== false) { - return t766(k1283); - } - else { - var t2352 = new SPOCK.Char(")"); - var t2351 = SPOCK.eqvp(t774, t2352); - var t1061 = t2351; - var t2353; - if(t1061 !== false) { - t2353 = true; - } - else { - var t2355 = new SPOCK.Char("]"); - var t2354 = SPOCK.eqvp(t774, t2355); - var t1062 = t2354; - var t2356; - if(t1062 !== false) { - t2356 = true; - } - else { - var t2358 = new SPOCK.Char("}"); - var t2357 = SPOCK.eqvp(t774, t2358); - var t1063 = t2357; - var t2359; - if(t1063 !== false) { - t2359 = true; - } - else { - t2359 = false; - } - t2356 = t2359; - } - t2353 = t2356; - } - var t2350; - if(t2353 !== false) { - return ____25error(k1283, "unexpected delimiter", t770); - } - else { - var t2361 = (t770) .character.match(/^\s$/) ; - var t807 = t2361; - var t2363 = null; - var t2362 = (t807) === (t2363); - var t806 = t2362; - var t2364; - if(t806 !== false) { - t2364 = false; - } - else { - t2364 = true; - } - var t1064 = t2364; - var t2365; - if(t1064 !== false) { - return t761(k1283); - } - else { - var t2367 = function (t1297) { - var t810 = t1297; - var t1296 = t810; - var t2368 = function (t1295) { - return t760(k1283, t1295); - }; - return t767(t2368, t1296); - }; - return ____25list(t2367, t770); - } - t2350 = t2365; - } - t2345 = t2350; - } - t2338 = t2345; - } - t2328 = t2338; - } - t2318 = t2328; - } - t2297 = t2318; - } - t2291 = t2297; - } - t2285 = t2291; - } - t2279 = t2285; - } - t2274 = t2279; - } - t2272 = t2274; - } - }; - return t750(t2270, t758); - }; - t761 = t2269; // set! t761 - var t2373 = function (k1298) { // t762 - var t2374 = function (t1299) { - var t811 = t1299; - var t816 = SPOCK.EOF; - var t2375 = (t811) === (t816); - var t813 = t2375; - var t2376; - if(t813 !== false) { - t2376 = t813; - } - else { - var t2378 = new SPOCK.Char("\n"); - var t2377 = t2378.character; - var t819 = t2377; - var t2379 = t811.character; - var t820 = t2379; - var t2380 = (t819) === (t820); - t2376 = t2380; - } - var t812 = t2376; - var t2381; - if(t812 !== false) { - t2381 = false; - } - else { - t2381 = true; - } - var t1065 = t2381; - var t2382; - if(t1065 !== false) { - return t762(k1298); - } - else { - return k1298(undefined); - } - }; - return t750(t2374, t758); - }; - t762 = t2373; // set! t762 - var t2386 = function (k1300) { // t763 - var t2387 = function (t1301) { - var t821 = t1301; - var t2388 = (t821) .character.match(/^\s$/) ; - var t824 = t2388; - var t2390 = null; - var t2389 = (t824) === (t2390); - var t823 = t2389; - var t2391; - if(t823 !== false) { - t2391 = false; - } - else { - t2391 = true; - } - var t1066 = t2391; - var t2392; - if(t1066 !== false) { - var t2393 = function (t1302) { - return t763(k1300); - }; - return t750(t2393, t758); - } - else { - return k1300(t821); - } - }; - return t752(t2387, t758); - }; - t763 = t2386; // set! t763 - var t2398 = function (k1303) { // t764 - var t2399 = function (t1304) { - var t827 = t1304; - var t830 = SPOCK.EOF; - var t2400 = (t827) === (t830); - var t1067 = t2400; - var t2401; - if(t1067 !== false) { - return ____25error(k1303, "unexpected EOF after `#'"); - } - else { - var t831 = t827; - var t2405 = new SPOCK.Char("t"); - var t2404 = SPOCK.eqvp(t827, t2405); - var t1068 = t2404; - var t2406; - if(t1068 !== false) { - t2406 = true; - } - else { - var t2408 = new SPOCK.Char("T"); - var t2407 = SPOCK.eqvp(t827, t2408); - var t1069 = t2407; - var t2409; - if(t1069 !== false) { - t2409 = true; - } - else { - t2409 = false; - } - t2406 = t2409; - } - var t2403; - if(t2406 !== false) { - return k1303(true); - } - else { - var t2413 = new SPOCK.Char("f"); - var t2412 = SPOCK.eqvp(t827, t2413); - var t1070 = t2412; - var t2414; - if(t1070 !== false) { - t2414 = true; - } - else { - var t2416 = new SPOCK.Char("F"); - var t2415 = SPOCK.eqvp(t827, t2416); - var t1071 = t2415; - var t2417; - if(t1071 !== false) { - t2417 = true; - } - else { - t2417 = false; - } - t2414 = t2417; - } - var t2411; - if(t2414 !== false) { - return k1303(false); - } - else { - var t2421 = new SPOCK.Char("("); - var t2420 = SPOCK.eqvp(t827, t2421); - var t1072 = t2420; - var t2422; - if(t1072 !== false) { - t2422 = true; - } - else { - t2422 = false; - } - var t2419; - if(t2422 !== false) { - var t2423 = function (t1305) { - return t753(k1303, t1305); - }; - var t2425 = new SPOCK.Char(")"); - return t765(t2423, t2425); - } - else { - var t2429 = new SPOCK.Char("%"); - var t2428 = SPOCK.eqvp(t831, t2429); - var t1073 = t2428; - var t2430; - if(t1073 !== false) { - t2430 = true; - } - else { - var t2432 = new SPOCK.Char("!"); - var t2431 = SPOCK.eqvp(t831, t2432); - var t1074 = t2431; - var t2433; - if(t1074 !== false) { - t2433 = true; - } - else { - t2433 = false; - } - t2430 = t2433; - } - var t2427; - if(t2430 !== false) { - var t2434 = function (t1308) { - var t846 = t1308; - var t1307 = t846; - var t2435 = function (t1306) { - return ___string_2d_3esymbol(k1303, t1306); - }; - return t767(t2435, t1307); - }; - var t2438 = new SPOCK.Char("#"); - return ____25list(t2434, t827, t2438); - } - else { - var t2442 = new SPOCK.Char("\\"); - var t2441 = SPOCK.eqvp(t831, t2442); - var t1075 = t2441; - var t2443; - if(t1075 !== false) { - t2443 = true; - } - else { - t2443 = false; - } - var t2440; - if(t2443 !== false) { - var t2444 = function (t1309) { - var t849 = t1309; - var t2446 = SPOCK.jstring("newline"); - var t2445 = t2446.toLowerCase(); - var t852 = t2445; - var t2448 = SPOCK.jstring(t849); - var t2447 = t2448.toLowerCase(); - var t853 = t2447; - var t2449 = (t852) === (t853); - var t1076 = t2449; - var t2450; - if(t1076 !== false) { - var t2451 = new SPOCK.Char("\n"); - return k1303(t2451); - } - else { - var t2454 = SPOCK.jstring("tab"); - var t2453 = t2454.toLowerCase(); - var t858 = t2453; - var t2456 = SPOCK.jstring(t849); - var t2455 = t2456.toLowerCase(); - var t859 = t2455; - var t2457 = (t858) === (t859); - var t1077 = t2457; - var t2458; - if(t1077 !== false) { - var t2459 = new SPOCK.Char("\t"); - return k1303(t2459); - } - else { - var t2462 = SPOCK.jstring("space"); - var t2461 = t2462.toLowerCase(); - var t864 = t2461; - var t2464 = SPOCK.jstring(t849); - var t2463 = t2464.toLowerCase(); - var t865 = t2463; - var t2465 = (t864) === (t865); - var t1078 = t2465; - var t2466; - if(t1078 !== false) { - var t2467 = new SPOCK.Char(" "); - return k1303(t2467); - } - else { - var t2470 = SPOCK.jstring(t849); - var t2469 = t2470.length; - var t868 = t2469; - var t2471 = (0) === (t868); - var t1079 = t2471; - var t2472; - if(t1079 !== false) { - return ____25error(k1303, "invalid character syntax"); - } - else { - return ___string_2dref(k1303, t849, 0); - } - t2466 = t2472; - } - t2458 = t2466; - } - t2450 = t2458; - } - }; - var t2475 = null; - return t767(t2444, t2475); - } - else { - return ____25error(k1303, "invalid `#' syntax", t827); - } - t2427 = t2440; - } - t2419 = t2427; - } - t2411 = t2419; - } - t2403 = t2411; - } - t2401 = t2403; - } - }; - return t750(t2399, t758); - }; - t764 = t2398; // set! t764 - var t2479 = function (k1310, t873) { // t765 - var r = SPOCK.count(arguments); - if(r) return r; - var t874 = undefined; - var t2480 = function (k1311, t875) { // t874 - var r = SPOCK.count(arguments); - if(r) return r; - var t2481 = function (t1312) { - var t876 = t1312; - var t879 = SPOCK.EOF; - var t2482 = (t876) === (t879); - var t1080 = t2482; - var t2483; - if(t1080 !== false) { - return ____25error(k1311, "unexpected EOF while reading list"); - } - else { - var t881 = t873; - var t2485 = t876.character; - var t882 = t2485; - var t2486 = t881.character; - var t883 = t2486; - var t2487 = (t882) === (t883); - var t1081 = t2487; - var t2488; - if(t1081 !== false) { - var t2489 = function (t1313) { - return t751(k1311, t875); - }; - return t750(t2489, t758); - } - else { - var t2493 = new SPOCK.Char("."); - var t2492 = SPOCK.eqvp(t2493, t876); - var t1082 = t2492; - var t2494; - if(t1082 !== false) { - var t2495 = function (t1314) { - var t886 = t1314; - var t2496 = SPOCK.jstring("."); - var t889 = t2496; - var t2497 = SPOCK.jstring(t886); - var t890 = t2497; - var t2498 = (t889) === (t890); - var t1083 = t2498; - var t2499; - if(t1083 !== false) { - var t2500 = function (t1315) { - var t893 = t1315; - var t2501 = function (t1316) { - var t2502 = function (t1317) { - var t894 = t1317; - var t895 = t873; - var t2503 = SPOCK.eqvp(t894, t895); - var t1084 = t2503; - var t2504; - if(t1084 !== false) { - var t2505 = function (t1318) { - return ___append(k1311, t1318, t893); - }; - return t751(t2505, t875); - } - else { - return ____25error(k1311, "missing closing delimiter", t873); - } - }; - return t750(t2502, t758); - }; - return t763(t2501); - }; - return t761(t2500); - } - else { - var t2512 = function (t1320) { - var t896 = t1320; - var t2513 = new SPOCK.Pair(t896, undefined); - var t1319 = t2513; - return t874(k1311, t1319, t875); - }; - return t760(t2512, t886); - } - }; - var t2516 = null; - return t767(t2495, t2516); - } - else { - var t2518 = function (t1322) { - var t898 = t1322; - var t2519 = new SPOCK.Pair(t898, t875); - var t1321 = t2519; - return t874(k1311, t1321); - }; - return t761(t2518); - } - t2488 = t2494; - } - t2483 = t2488; - } - }; - return t763(t2481); - }; - t874 = t2480; // set! t874 - var t2523 = null; - return t874(k1310, t2523); - }; - t765 = t2479; // set! t765 - var t2525 = function (k1323) { // t766 - var t900 = undefined; - var t2526 = function (k1324, t901) { // t900 - var r = SPOCK.count(arguments); - if(r) return r; - var t2527 = function (t1325) { - var t902 = t1325; - var t905 = SPOCK.EOF; - var t2528 = (t902) === (t905); - var t1085 = t2528; - var t2529; - if(t1085 !== false) { - return ____25error(k1324, "unexpected EOF while reading string"); - } - else { - var t2532 = new SPOCK.Char("\""); - var t2531 = t2532.character; - var t908 = t2531; - var t2533 = t902.character; - var t909 = t2533; - var t2534 = (t908) === (t909); - var t1086 = t2534; - var t2535; - if(t1086 !== false) { - var t2536 = function (t1326) { - return t754(k1324, t1326); - }; - return t751(t2536, t901); - } - else { - var t2540 = new SPOCK.Char("\\"); - var t2539 = t2540.character; - var t912 = t2539; - var t2541 = t902.character; - var t913 = t2541; - var t2542 = (t912) === (t913); - var t1087 = t2542; - var t2543; - if(t1087 !== false) { - var t2544 = function (t1327) { - var t914 = t1327; - var t917 = SPOCK.EOF; - var t2545 = (t914) === (t917); - var t1088 = t2545; - var t2546; - if(t1088 !== false) { - return ____25error(k1324, "unexpected EOF while reading string"); - } - else { - var t2550 = new SPOCK.Char("n"); - var t2549 = SPOCK.eqvp(t914, t2550); - var t1089 = t2549; - var t2551; - if(t1089 !== false) { - t2551 = true; - } - else { - t2551 = false; - } - var t2548; - if(t2551 !== false) { - var t2553 = new SPOCK.Char("\n"); - var t2552 = new SPOCK.Pair(t2553, t901); - return t900(k1324, t2552); - } - else { - var t2557 = new SPOCK.Char("t"); - var t2556 = SPOCK.eqvp(t914, t2557); - var t1090 = t2556; - var t2558; - if(t1090 !== false) { - t2558 = true; - } - else { - t2558 = false; - } - var t2555; - if(t2558 !== false) { - var t2560 = new SPOCK.Char("\t"); - var t2559 = new SPOCK.Pair(t2560, t901); - return t900(k1324, t2559); - } - else { - var t2562 = new SPOCK.Pair(t914, t901); - return t900(k1324, t2562); - } - t2548 = t2555; - } - t2546 = t2548; - } - }; - return t750(t2544, t758); - } - else { - var t2565 = new SPOCK.Pair(t902, t901); - return t900(k1324, t2565); - } - t2535 = t2543; - } - t2529 = t2535; - } - }; - return t750(t2527, t758); - }; - t900 = t2526; // set! t900 - var t2568 = null; - return t900(k1323, t2568); - }; - t766 = t2525; // set! t766 - var t2570 = function (k1328, t931) { // t767 - var r = SPOCK.count(arguments); - if(r) return r; - var t932 = undefined; - var t2571 = function (k1329, t933) { // t932 - var r = SPOCK.count(arguments); - if(r) return r; - var t2572 = function (t1330) { - var t934 = t1330; - var t938 = SPOCK.EOF; - var t2573 = (t934) === (t938); - var t935 = t2573; - var t2574 = function (t1331) { // t1335 - var t1091 = t1331; - var t2575; - if(t1091 !== false) { - var t2576 = function (t1332) { - return t754(k1329, t1332); - }; - return t751(t2576, t933); - } - else { - var t2579 = function (t1334) { - var t945 = t1334; - var t2580 = new SPOCK.Pair(t945, t933); - var t1333 = t2580; - return t932(k1329, t1333); - }; - return t750(t2579, t758); - } - }; - var t1335 = t2574; - var t2583; - if(t935 !== false) { - return t1335(t935); - } - else { - var t2585 = function (t1336) { - var t939 = t1336; - var t2586; - if(t939 !== false) { - t2586 = t939; - } - else { - var t2587 = (t934) .character.match(/^\s$/) ; - var t942 = t2587; - var t2589 = null; - var t2588 = (t942) === (t2589); - var t941 = t2588; - var t2590; - if(t941 !== false) { - t2590 = false; - } - else { - t2590 = true; - } - t2586 = t2590; - } - return t1335(t2586); - }; - var t2592 = new SPOCK.Pair(new SPOCK.Char("{"), new SPOCK.Pair(new SPOCK.Char("}"), new SPOCK.Pair(new SPOCK.Char("("), new SPOCK.Pair(new SPOCK.Char(")"), new SPOCK.Pair(new SPOCK.Char("["), new SPOCK.Pair(new SPOCK.Char("]"), new SPOCK.Pair(new SPOCK.Char(";"), new SPOCK.Pair(new SPOCK.Char("\""), null)))))))); - return ___memv(t2585, t934, t2592); - } - }; - return t752(t2572, t758); - }; - t932 = t2571; // set! t932 - return t932(k1328, t931); - }; - t767 = t2570; // set! t767 - return t761(k1279); - }; - var t1337 = t2262; - var t2597; - if(t1049 !== false) { - return t755(t1337); - } - else { - return t1337(t757); - } - }; - ___read = t2260; // set! read - var t2600 = function (k1338, t947, t948) { // load - var r = SPOCK.count(arguments); - if(r) return r; - loop: while(true) { - var t2602 = SPOCK.jstring(t947); - var t2603 = t948 === undefined; - var t950 = t2603; - var t2604; - if(t950 !== false) { - t2604 = false; - } - else { - t2604 = true; - } - var t1092 = t2604; - var t2605; - if(t1092 !== false) { - var t2606 = SPOCK.callback(t948); - t2605 = t2606; - } - else { - t2605 = false; - } - var t2601 = SPOCK.load(t2602, t2605); - return k1338(t2601); - } - }; - ___load = t2600; // set! load - var t2608 = function(K) { - SPOCK.count(arguments, '%error'); - SPOCK.error.apply(SPOCK.global, Array.prototype.slice.call(arguments, 1)); - }; - ____25error = t2608; // set! %error - ___error = ____25error; // set! error - var t2609 = function (k1339, t952) { // exit - var r = SPOCK.count(arguments); - if(r) return r; - loop: while(true) { - var t2611 = t952 === undefined; - var t1093 = t2611; - var t2612; - if(t1093 !== false) { - t2612 = 0; - } - else { - t2612 = t952; - } - var t2610 = SPOCK.exit(t2612); - return k1339(t2610); - } - }; - ___exit = t2609; // set! exit - var t2614 = function (k1340, t954) { // milliseconds - var r = SPOCK.count(arguments); - if(r) return r; - var t2615 = (new Date()).getTime(); - var t955 = t2615; - var t2616 = t954 === undefined; - var t1094 = t2616; - var t2617; - if(t1094 !== false) { - return k1340(t955); - } - else { - var t2619 = function (t1341) { - var t2620 = (new Date()).getTime(); - var t958 = t2620; - var t2621 = (t958) - (t955); - return k1340(t2621); - }; - return t954(t2619); - } - }; - ___milliseconds = t2614; // set! milliseconds - var t2624 = function (k1342, t959) { // print - var t959 = SPOCK.rest(arguments, 1); - var t2625 = function (t1343) { - return ___newline(k1342); - }; - return ___for_2deach(t2625, ___display, t959); - }; - ___print = t2624; // set! print - var t2628 = function (k1344, t960) { // o - var t960 = SPOCK.rest(arguments, 1); - var t2630 = null; - var t2629 = (t960) === (t2630); - var t1095 = t2629; - var t2631; - if(t1095 !== false) { - var t2632 = function (k1345, t964) { - var r = SPOCK.count(arguments); - if(r) return r; - loop: while(true) { - return k1345(t964); - } - }; - return k1344(t2632); - } - else { - var t965 = undefined; - var t2635 = function (k1346, t966) { // t965 - var r = SPOCK.count(arguments); - if(r) return r; - var t2636 = t966.car; - var t967 = t2636; - var t2637 = t966.cdr; - var t968 = t2637; - var t2639 = null; - var t2638 = (t968) === (t2639); - var t1096 = t2638; - var t2640; - if(t1096 !== false) { - t2640 = t967; - } - else { - var t2641 = function (k1347, t974) { - var r = SPOCK.count(arguments); - if(r) return r; - var t2642 = function (t1349) { - var t2643 = function (t1348) { - return t967(k1347, t1348); - }; - return t1349(t2643, t974); - }; - return t965(t2642, t968); - }; - t2640 = t2641; - } - return k1346(t2640); - }; - t965 = t2635; // set! t965 - return t965(k1344, t960); - } - }; - ___o = t2628; // set! o - var t2649 = function(K) { - SPOCK.count(arguments, '%'); - var o = {}; - for(var i = 1; i < arguments.length; i += 2) { - var x = arguments[ i ]; - if(typeof x === 'string') o[ x ] = arguments[ i + 1 ]; - else if(x instanceof SPOCK.String) - o[ x.name ] = arguments[ i + 1 ]; - else SPOCK.error('(%) object key not a string or symbol', x);} - return K(o); - }; - ____25 = t2649; // set! % - var t2650 = function(K) { - SPOCK.count(arguments, 'native'); - var func = arguments[ 1 ]; - return K(function(k) { - var args = Array.prototype.splice.call(arguments, 1); - return k(func.apply(SPOCK.global, args));}); - }; - ___native = t2650; // set! native - var t2651 = function(K) { - SPOCK.count(arguments, 'native-method'); - var func = arguments[ 1 ]; - return K(function(k) { - var args = Array.prototype.splice.call(arguments, 2); - return k(func.apply(arguments[ 1 ], args));}); - }; - ___native_2dmethod = t2651; // set! native-method - var t2652 = function(K) { - SPOCK.count(arguments, 'bind-method'); - var func = arguments[ 1 ]; - var that = arguments[ 2 ]; - return K(function() { return func.apply(that, arguments); }); - }; - ___bind_2dmethod = t2652; // set! bind-method - var t2653 = function(K) { - SPOCK.count(arguments, 'jstring'); - var x = arguments[ 1 ]; - if(typeof x === 'string') return K(x); - else if(x instanceof SPOCK.String) return K(x.normalize()); - else if(x instanceof SPOCK.Char) return K(x.character); - else return K(x); - }; - ___jstring = t2653; // set! jstring - return k1097(undefined); -}; -SPOCK.run(t1350); -SPOCK.flush(); -/* END OF GENERATED CODE */