aboutsummaryrefslogtreecommitdiff
path: root/bqn.js
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2021-08-30 14:23:07 -0400
committerMarshall Lochbaum <mwlochbaum@gmail.com>2021-08-30 14:24:04 -0400
commit3761d5a57ab3c9ee6db96a4e1381048f1060a71c (patch)
tree544fdcba547fa169b0862dbd1f9b4d2d6ead9cb6 /bqn.js
parent13318ddb9ec7b51baa7d9d693f2392d1de270acc (diff)
Expose REPL functionality more cleanly, fixing •path in Node REPL
Diffstat (limited to 'bqn.js')
-rwxr-xr-xbqn.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/bqn.js b/bqn.js
index 04fe0b96..a0d8be07 100755
--- a/bqn.js
+++ b/bqn.js
@@ -6,10 +6,10 @@ let fs = require('fs');
let bqn = require("./docs/bqn.js");
module.exports = bqn;
-let {fmt,fmtErr,sysvals,sysargs,makebqn}=bqn;
+let {fmt,fmtErr,sysvals,sysargs,makebqn,makerepl}=bqn;
let {has,list,str,unstr,dynsys,req1str,makens}=bqn.util;
-let bqn_state=makebqn((u,s,x,w)=>(u(s,w),x));
-let bqn_nostate=makebqn((u,s,x,w)=>x);
+let bqn_state=makebqn((x,w,u,s)=>(u(s,w),x));
+let bqn_nostate=makebqn(x=>x);
let show = x => console.log(fmt(x));
sysvals.show = (x,w) => { show(x); return x; };
@@ -152,8 +152,8 @@ if (!module.parent) {
}
if (!has(arg0) || arg0==='-r') {
let stdin = process.stdin;
- let repl = sysvals.rebqn(cl_state())(makens(["repl"],[str("loose")]));
- let e = exec(s=>show(repl(str(s))));
+ let repl = makerepl(cl_state(), 1);
+ let e = exec(s=>show(repl(s)));
stdin.on('end', () => { process.exit(); });
stdin.on('readable', () => {
let inp; while ((inp=stdin.read())!==null) {