Question: how to build double subscript name on the fly? "v__i" where "i" is variable?

I needed to make symbolic vector, as in  

my_vector:=Vector([v__1,v__2,v__3])

The problem is that, the proc called, has to create this vector on the fly, since the dimension changes on each call. So I used seq command to generate it. But seq did not work. I tried

my_vector:=Vector([seq('v__i',i=1..3)])

 

After looking more at it, It seems to have nothing to do with evaluation. If the subscript index is variable, it does not work.

 

f:=proc(v::symbol,i::posint)  
  print("i=",i);
  print("v__i=",v__i); 
  return (v__i);
end proc;

f(v,2)

One way is to use v[i] instead of v__i, and now it works:

[seq('v[i]',i=1..3)]

But since subscripted variable are supposed to be safer than indexed variable, I wanted to use v__i and not v[i].

 

Why it does not work? And is there a workaround this?  

ps. I could always do this 

V:=[seq(:-parse(cat("v__",convert(i,string))),i=1..3)]
lprint(V[1])

But this seems like a hack to me and I do not know why it should be needed.

ps. any one knows where help on "__" is in Maple? I can't find it. doing ?__ turns out nothing. I do not know under what name help on double subscript is in maple.

Maple 2020.1

Please Wait...