# Dependent variables in With operator [duplicate]

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?

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