aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2021-01-23 20:51:11 -0500
committerMarshall Lochbaum <mwlochbaum@gmail.com>2021-01-23 20:51:11 -0500
commit549ea80c4ac76b97467688431df8d19d707705d0 (patch)
treea003aafe6d69134ec9f6432dd1fdf85ee2fc1b1d
parent3a6334cddc9db27a08019c82fb10b5e00b659854 (diff)
Set fill for group_len and group_ord
-rw-r--r--docs/bqn.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/docs/bqn.js b/docs/bqn.js
index 13342901..9818f61b 100644
--- a/docs/bqn.js
+++ b/docs/bqn.js
@@ -164,13 +164,13 @@ let group_len = (x,w) => { // ≠¨⊔ for a valid list argument
let l=x.reduce((a,b)=>Math.max(a,b),-1);
let r=Array(l+1).fill(0);
x.map(e=>{if(e>=0)r[e]+=1;});
- return list(r);
+ return list(r,0);
}
let group_ord = (x,w) => { // ∾⊔x assuming w=group_len(x)
let l=0,s=w.map(n=>{let l0=l;l+=n;return l0;});
let r=Array(l);
x.map((e,i)=>{if(e>=0)r[s[e]++]=i;});
- return list(r);
+ return list(r,x.fill);
}
let type = x => isfunc(x) ? 3+(x.m||0) : x.sh ? 0 : 2-isnum(x);
let decompose = x => list(!isfunc(x) ? [-1,x]