I want to make an animation in XPCE, consisting of an arbitrary number of moving circles. The circles are given in a Prolog list, containing for each circle its coordinates, radius, and colour. Hence, the list looks like this: [[[1,2],20,red],[[40,2],15,green],...] I can of course generate a circle, name it and colour it as follows:
new(@p,picture).
send(@p,display,new(@ci,circle(20)),point(1,2)).
send(@ci,fill_pattern,colour(red)).
But what do I do when I want to represent the whole list? I would somehow need dynamic names, but things like
send(@p,display,new(@X,circle(20)),point(1,2)).
where X is some identifier specified earlier are not accepted.