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?

  • 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.