Carl Love

Carl Love

28110 Reputation

25 Badges

13 years, 113 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

MaplePrimes Activity


These are replies submitted by Carl Love

> Multiple assignment to a vector causes different names pointing to the same object.

 

It is not multiple assignment that causes the problem.  The problem is that the left-side argument to $ is evaluated before being duplicated, as are most operands to most operators.  So both of the following will work, producing two distinct vectors:

 

v1, v2:= 'Vector'(2) $ 2;

 

or

 

v1,v2:= seq(Vector(2), k= 1..2);

> Multiple assignment to a vector causes different names pointing to the same object.

 

It is not multiple assignment that causes the problem.  The problem is that the left-side argument to $ is evaluated before being duplicated, as are most operands to most operators.  So both of the following will work, producing two distinct vectors:

 

v1, v2:= 'Vector'(2) $ 2;

 

or

 

v1,v2:= seq(Vector(2), k= 1..2);

First 702 703 704 705 706 707 708 Page 704 of 710