Eigenstate: myrddin-dev mailing list

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

Re: The meaning of pattern variables


It makes sense now after reading up the spec.
I should have done that before making stubborn assumptions.

On 7 December 2017 at 14:25, nml <arumakanil@xxxxxxxxx> wrote:

>
> 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 variablesOri Bernstein <ori@xxxxxxxxxxxxxx>
References:
The meaning of pattern variablesnml <arumakanil@xxxxxxxxx>