Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I noticed that I often turn out to have a list of substitutions in the form

list = 
  {var1 -> value1, var2 -> value2, ..., varn -> valuen}, 
  {var1 -> value1, var2 -> value2, ..., varn ->  valuen}

and need to extract some of the values (for instance for plotting). I use the syntax

{var1, var2} /. # & /@ list

Is there a shorter one?

share|improve this question
@PinguinDirk I disagree with your reasoning. Function has very low precedence and everything before & will be "inside" Function. The FullForm is Hold[Map[Function[ReplaceAll[List[var1,var2],Slot[1]]],list]]. But still your solution is correct :P – Jacob Akkerboom Jul 4 '13 at 13:30
oh, right, let's delete that comment (as it is too late to edit) and just keep the idea: {var1, var2} /. list. Thank you sir for pointing that out! – Pinguin Dirk Jul 4 '13 at 13:36
This question appears to be off-topic because it only applies to the poster's local situation and needs. – m_goldberg Jul 4 '13 at 14:06
@PinguinDirk Thank you – Fabio Dalla Libera Jul 4 '13 at 14:30
@m_goldberg I don't know how to reformulate the question as to make it more easily found by related searches. If you have any idea, please feel free to edit the title or content – Fabio Dalla Libera Jul 4 '13 at 14:31
up vote 8 down vote accepted

Yes, remove the Map entirely. For example,

{a, b} /. {{a -> q, b -> r}, {a -> s, b -> t}}
(* {{q, r}, {s, t}} *)
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.