New answers tagged

1

After one week of constant trial and error, I discovered that I only have to use the attribute HoldAllComplete instead of HoldAll: SetAttributes[mySum, HoldAllComplete]; mySum[arg_, {index_Symbol, limits___}] := Block[{index, evaluatedarg}, Print["debug msg 1"]; evaluatedarg = arg; With[{replaceevaluated = evaluatedarg}, ...


9

You can safely ignore the warning and red highlighting. It simply tells you that the variable will be injected into Block by the top-level rule (your function), rather than being the actual symbol originally present in Block's declaration list. Which is exactly what you want here. In most cases, things like that happen due to a programmer's mistake, which ...



Top 50 recent answers are included