Cairo: let vs tempvar what is the difference?

66 views Asked by At

I'm new to Cairo and I want to know what is the difference when I write let x = 1; and tempvar x = 1;. Is there any difference in Cairo Lang between let and tempvar?

1

There are 1 answers

0
David Barreto On

Yes, there's a difference. The keyword let creates a reference that's resolved by the compiler while tempvar actually stores the variable in the stack using a specialized register called the ap pointer. You can find more information about it here