Eigenstate: myrddin-dev mailing list

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

The meaning of pattern variables


As far as I understand the assignment operator (=) can have two meanings.
The first is binding a value to an identifier, which is a compile-time
operation, which does not map directly to generated machine code.
The second is storing a value to a location represented by a variable.


What is the case for pattern variables like `i` in `for i : [Foo Bar Baz]`?

I suppose they are identifier binding and no new variable allocations and
assignment(storing) is involved. So `i` should have exactly the same lvalue
as the variables it is bound to.

Which means &i == &Foo when i is bound to Foo. Do I understand it correctly?


--
mura

Follow-Ups:
Re: The meaning of pattern variablesnml <arumakanil@xxxxxxxxx>