Confusing ReplaceRepeated & Hold@J.M. And yes--since I'm just starting, I am very concerned with writing proper, idiomatic code that resemble mathematical/pragmatic notation as much as possible...

Oct4

comment

Confusing ReplaceRepeated & HoldHmm I think I get the idea about how and why Hold[] works now. I don't really like the idea of injecting syntactic noise into mathematical notation, so could you please suggest a way I could rewrite the code in a more idiomatic way?

Confusing ReplaceRepeated & HoldYes I have already figured out that OP-v1 expanded first to {_,_}-v1 then {_-v1,_-v1}, before v1 even got expanded, where the - was understood as operation between vector and scalar, all while I really mean to "expand both OP and v1 before applying the vector difference"...

Mathematica is a registered trademark of Wolfram Research, Inc. While the mark is used herein with the limited permission of Wolfram Research, Stack Exchange and this site disclaim all affiliation therewith.