# Animate: surprise over discrete lists

Consider Animate[xs, {xs, {0, 1, 2}}]. By my reading of the documentation,

Animate[expr,{u,{u1,u2,…}}]
makes u take on discrete values u1, u2, ….


my expression should produce an animation that steps from 0 to 1 to 2 and back to 0 in a loop, and, indeed it does:

Now, consider Animate[xs, {xs, {{"A", 0}, {"B", 1}, {"C", 2}}}]. I would expect xs to take on the values {"A", 0}, {"B", 1}, and {"C", 2} in a loop, just as xs took on the values 0, 1, and 2 in a loop. I do not get what I expect. Instead, the display shows only "A", "B", "C" and the slider has a small excursion from 0 to 1 and a large excursion from 1 to 2:

Guessing that the second argument in each list tells Animate how long, relatively, to dwell on each frame, if I turn things around, Animate[xs, {xs, {0, "A"}, {1, "B"}, {2, "C"}}], I get a frozen animator, though with no error message.

Under that hypothesis, I get what I want as follows

or, without the hypothesis, sort-of like this:

Did I miss something in the documentation? Did I misunderstand the documentation? Did I stumble on undocumented (albeit useful) behavior?

• nice find! (+++1) – kglr Sep 27 '19 at 16:02