This question already has an answer here:

I want write something like this

With[{x=1, y=x+1}, y]

and get 2 as an answer. What is the correct way to do this?


marked as duplicate by halirutan, Lukas Lang, andre314, Community May 31 '18 at 16:34

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 2
    $\begingroup$ Either With[{x=1},With[{y=x+1}, y]] or you can use LetL by Leonid Shifrin. $\endgroup$ – Henrik Schumacher May 31 '18 at 15:14
  • 3
    $\begingroup$ Undcumented: With[{x=1}, {y=x+1}, y] $\endgroup$ – Fred Simons May 31 '18 at 15:14
  • $\begingroup$ I'm voting to close this as a duplicate. The question is good, but all you want to know is given by Michael's answer in the link that adre gave above. $\endgroup$ – halirutan May 31 '18 at 16:07

Browse other questions tagged or ask your own question.