Skip to content

How to SWAP in Mojo #312

Closed Locked Answered by lattner
Sai-Vignesh asked this question in Q&A
Discussion options

You must be logged in to vote

Thanks for the nudge, I implemented support for tuples on the left side. They still require parens, but this allows (a, b) = (b, a) to work in the next update. In the meantime you can use a temporary like:

tmp = a
a = b
b = tmp

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by lattner
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants