1
$\begingroup$

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?

$\endgroup$
3
  • 2
    $\begingroup$ Either With[{x=1},With[{y=x+1}, y]] or you can use LetL by Leonid Shifrin. $\endgroup$ May 31, 2018 at 15:14
  • 3
    $\begingroup$ Undcumented: With[{x=1}, {y=x+1}, y] $\endgroup$ May 31, 2018 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, 2018 at 16:07

0

Browse other questions tagged or ask your own question.