Changing a parameter within border command

Suppose I create a border using

real a = 1;
border b1(t=0,1){x=a*t;y=t;}

Then I create a second border using the identical code, but with variable a changed:

a = 2;
border b2(t=0,1){x=a*t;y=t;}

These two borders are actually identical, because when they’re invoked (for instance, in plot or buildmesh), they use the current value of the variable a.

Is there a way to overcome this behavior, so that the two borders would actually end up being different?

(I’m trying to write a long border made up of many line segments for which it would be much easier if, before each border segment definition, I could define variable x0, y0, x1, y1 that are the endpoints of the border. But because of the above behavior, all borders use the final values of x0, y0, x1, y1, not the ones set just before border definition.)

I’m not sure if what I asked is possible, but in the end I found an example (under “mesh building with array of border” in the help file) that shows essentially how to do what I needed: make a border from a list of vertex points.

Yes , it is impossible because the value of “a” is taken at time when you build the mesh.