Bill Allombert on Thu, 19 Jun 2003 17:58:18 +0200


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

Re: Vector bug


On Thu, Jun 19, 2003 at 04:22:27PM +0100, Jon Perry wrote:
> ? a=[1]
> %57 = [1]
> ? a=vector(100,i,a[1]+1)
> %58 = [2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
> 2, 2
> , 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
> 2,
> 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
> 2, 2,
>  2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2]
> ?
> 
> By my reckoning, when i=1, a[1] becomes 2, and so by i=2, a[2] should be
> evaluated using the most current a[1] value, i.e. 2, so the vector returned
> should be [2, 3, 3, ...].

How do you expect that to happen ? GP first compute vector(100,i,a[1]+1)
and then store the result in a.

Cheers,
Bill.