Question: Updating of values

Sorry to bother you with another very basic question.

This very simple example shows that Maple gives the first value that is defined back, ignoring changes further down the definition chain.

Could someone explain why, and if there is a way to always get the updated values?


 

m := Matrix(2, 2, {(1, 1) = 1, (1, 2) = 3, (2, 1) = 2, (2, 2) = 4})

Matrix(%id = 18446745932232999750)

(1)

a := 1

1

(2)

b := m[a, 1]

1

(3)

a := 2

2

(4)

b

1

(5)

m[2, 1]

2

(6)

``


 

Download VariableIndex.mw

Please Wait...