# Dependent variables in With operator [duplicate]

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.

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