Tagged Questions
1
vote
0answers
55 views
Evaluation in mapping constructs [closed]
I'm trying to use ReplacePart inside of Map, where the address of the element being replaced is the domain of the map, like this:
...
7
votes
2answers
193 views
Why does the name of a pattern affect the result of a transformation rule?
I was playing a little dirty, trying to get a template for defining a Curl[] operator.
I wrote the following rule, which I knew was going to spit out a few ...
11
votes
3answers
241 views
Returning an unevaluated expression with values substituted in
Let's say I have a function
formula[x_List] := (x[[1]] - x[[2]]) + (x[[3]] - x[[4]]);
and I want to pass it a variable and get back the unevaluated formula with ...
3
votes
1answer
110 views
Set promotes Rule to RuleDelayed?
In mentally building a model of how Mathematica works, I naively expected Set to create a Rule in a symbol's ...
8
votes
2answers
473 views
Mathematica rule substitution memory
First I present the specific programming question, and then I provide further background details.
Given an expression in Mathematica, say f=3x+7y, there are two ...
24
votes
9answers
780 views
Injecting a sequence of expressions into a held expression
Consider the following toy example:
Hold[{1, 2, x}] /. x -> Sequence[3, 4]
It will give
Hold[{1, 2, Sequence[3, 4]}]
...