diff options
| author | Marshall Lochbaum <mwlochbaum@gmail.com> | 2020-12-13 14:40:44 -0500 |
|---|---|---|
| committer | Marshall Lochbaum <mwlochbaum@gmail.com> | 2020-12-13 14:40:44 -0500 |
| commit | 05bf5980f8e7e5bcf74676370fbabefa203ee5c4 (patch) | |
| tree | 1bced102a068971dab3c80f2a4a1a975722d22a7 /docs/bqn.js | |
| parent | 624c8d09f2f8a0268865b326dbfcae5ff0f054d7 (diff) | |
Fix VM-provided table and scan Decompose representations
Diffstat (limited to 'docs/bqn.js')
| -rw-r--r-- | docs/bqn.js | 4 |
1 files changed, 2 insertions, 2 deletions
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"); |
