From 4791da6b4787595e213ea8778409f358495ead3b Mon Sep 17 00:00:00 2001 From: pzinn Date: Fri, 29 Nov 2024 08:57:18 +1100 Subject: [PATCH] fix augmented ops --- M2/Macaulay2/d/evaluate.d | 37 +++++++++++-------------------------- 1 file changed, 11 insertions(+), 26 deletions(-) diff --git a/M2/Macaulay2/d/evaluate.d b/M2/Macaulay2/d/evaluate.d index f3bfaf394f..bb3f03e8d8 100644 --- a/M2/Macaulay2/d/evaluate.d +++ b/M2/Macaulay2/d/evaluate.d @@ -1274,34 +1274,19 @@ augmentedAssignmentFun(x:augmentedAssignmentCode):Expr := ( else return r) else return r); -- if not, use default behavior + r:=nullE; + f:=s.binary; if f==dummyBinaryFun then + r=binarymethod(Code(left),x.rhs,SymbolClosure(globalFrame,s)) + else + r=f(Code(left),x.rhs); + when r is e:Error do Expr(e) else ( when x.lhs - is y:globalMemoryReferenceCode do ( - r := s.binary(Code(left), x.rhs); - when r is e:Error do Expr(e) - else globalAssignment(y.frameindex, x.info, r)) - is y:localMemoryReferenceCode do ( - r := s.binary(Code(left), x.rhs); - when r is e:Error do Expr(e) - else localAssignment(y.nestingDepth, y.frameindex, r)) - is y:threadMemoryReferenceCode do ( - r := s.binary(Code(left), x.rhs); - when r is e:Error do Expr(e) - else globalAssignment(y.frameindex, x.info, r)) - is y:binaryCode do ( - r := Code(binaryCode(s.binary, Code(left), x.rhs, dummyPosition)); - if y.f == DotS.symbol.binary || y.f == SharpS.symbol.binary - then AssignElemFun(y.lhs, y.rhs, r) - else InstallValueFun(CodeSequence( - convertGlobalOperator(x.info), y.lhs, y.rhs, r))) - is y:adjacentCode do ( - r := Code(binaryCode(s.binary, Code(left), x.rhs, dummyPosition)); - InstallValueFun(CodeSequence( - convertGlobalOperator(AdjacentS.symbol), y.lhs, y.rhs, r))) - is y:unaryCode do ( - r := Code(binaryCode(s.binary, Code(left), x.rhs, dummyPosition)); - UnaryInstallValueFun(convertGlobalOperator(x.info), y.rhs, r)) + is y:globalMemoryReferenceCode do globalAssignment(y.frameindex, x.info, r) + is y:localMemoryReferenceCode do localAssignment(y.nestingDepth, y.frameindex, r) + is y:threadMemoryReferenceCode do globalAssignment(y.frameindex, x.info, r) else buildErrorPacket( - "augmented assignment not implemented for this code"))); + "augmented assignment not implemented for this code") + ))); ----------------------------------------------------------------------------- steppingFurther(c:Code):bool := steppingFlag && (