> The binding of the argument to the function can never change, though the 
> values of that binding might.

It you be more correct to say that a method cannot change the binding of its 
arguments. You can change bindings, you just can't do it inside of a method 
because of scoping rules. It's just as you said in your second point.

> Is this how julia handles values and bindings, or it there more to this 
> picture?

You seem to have understood it correctly.


Your surprise may actually come from the fact that you read
`[1,2,3] == [1,2,3]`
while it was actually
`[1,2,3] === [1,2,3]`

The three equal signs represent a strong equality: the mathematical equality is 
not sufficient; the objects actually need to be the same, they should 
correspond to exactly the same data in memory, the same address.

This is precisely what you demonstrated.



I'm a bit more surprised with the first statement: 1 === 1. I guess Julia 
wouldn't allocate two different ojects in memory for that, maybe LLVM just 
replaces that with "true" directly. But I find it surprising because this kind 
of equality is only meaningful if you are comparing variables, not values.

I'm also wondering if `==` is required by `===`: would two view of the same 
array be ===-equal? Even if the first one sees the data as Int64 while the 
second one sees them as Float64?

I guess I'll have to spend 20 seconds on that tomorrow.

Reply via email to