From 53a4cfb43d9fe0f5654a20d7937ac653be6a30e3 Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Tue, 14 Jun 2022 22:06:14 -0400 Subject: Don't allow list destructuring with aliases in bqn.js and vm.bqn --- docs/bqn.js | 2 ++ 1 file changed, 2 insertions(+) (limited to 'docs') diff --git a/docs/bqn.js b/docs/bqn.js index 2ea49108..879859a6 100644 --- a/docs/bqn.js +++ b/docs/bqn.js @@ -75,6 +75,8 @@ let set = (d, id, v) => { let cs=v.sh.slice(1); let c=cs.reduce((a,b)=>a*b,1); let cell = j => arr(v.slice(c*j,c*j+c),cs,v.fill); id.map((n,j)=>set(d,n,cell(j))); + } else if (id.m) { + throw Error("← or ↩: Can't use alias in list destructuring"); } else { if (v.sh) { if (!eq(id.sh,v.sh)) throw Error("← or ↩: Target and value shapes don't match"); -- cgit v1.2.3