File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -1194,15 +1194,20 @@ globalAssignmentFun(x:globalAssignmentCode):Expr := (
11941194 globalAssignment(t.frameindex,t,newvalue));
11951195
11961196ParallelAssignmentError(n:int):Expr := buildErrorPacket(
1197- "parallel assignment: expected a sequence of " + tostring(n) + " values ");
1197+ "parallel assignment: expected a sequence of " + tostring(n) + " value(s) ");
11981198ParallelAssignmentErrorAt(n:int):Expr := buildErrorPacket(
11991199 "parallel assignment: failure at argument " + tostring(n));
12001200parallelAssignmentFun(x:parallelAssignmentCode):Expr := (
12011201 nlhs := length(x.lhs);
12021202 value := eval(x.rhs);
12031203 when value is Error do return value else nothing;
12041204 -- (x) = y should behave just like x = y
1205- if nlhs == 1 then value = seq(value);
1205+ if nlhs == 1 then (
1206+ when value is a:Sequence do (
1207+ -- unless y is a sequence of length 1, then it behaves like x = y#0
1208+ if length(a) == 1 then nothing
1209+ else value = ParallelAssignmentError(1))
1210+ else value = seq(value));
12061211 when value
12071212 is values:Sequence do (
12081213 if nlhs == length(values) then (
Original file line number Diff line number Diff line change @@ -105,6 +105,7 @@ assert Equation(z, 9)
105105-- (x) = y should behave like x = y
106106assert Equation ((x) = 5 , 5 )
107107assert Equation ((x) + = 2 , 7 )
108+ assert Equation ((x) = 1 :6, 6 ) -- except when the RHS is a sequence of length 1
108109
109110-- 0-length LHS
110111assert Equation (() = (), ())
You can’t perform that action at this time.
0 commit comments