From 05bf5980f8e7e5bcf74676370fbabefa203ee5c4 Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Sun, 13 Dec 2020 14:40:44 -0500 Subject: Fix VM-provided table and scan Decompose representations --- docs/bqn.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/bqn.js b/docs/bqn.js index f930752a..adf31c30 100644 --- a/docs/bqn.js +++ b/docs/bqn.js @@ -136,10 +136,10 @@ let lesseq = (x,w) => { let s=typeof w, t=typeof x; return +(s!==t ? s<=t : w<=x); } -let table = f => setrepr(()=>[4,table,f], (x,w) => !has(w) +let table = f => setrepr(()=>[4,f,table], (x,w) => !has(w) ? arr(x.map(e=>call(f,e)),x.sh) : arr([].concat.apply([],w.map(d=>x.map(e=>call(f,e,d)))),w.sh.concat(x.sh))); -let scan = f => setrepr(()=>[4,table,f], (x,w) => { +let scan = f => setrepr(()=>[4,f,scan], (x,w) => { if (has(w)) throw Error("`: No dyadic form"); let s=x.sh; if (!s||s.length===0) throw Error("`: 𝕩 must have rank at least 1"); -- cgit v1.2.3