It seems however that I can’t first assign x, then assign play, and then use set? For example the following doesn’t work the same way (executed consecutively) :
x = 1 + 2;
(x * 3).postln;
y = 1;
y + 2;
(y * 3).postln;
… do you expect the x and y lines to post the same things?
It’s the same as in your example. You start with a function, and play changes it into a synth (just like you can start with 1, and + 2 changes it into a different number). In the first case, it’s the new thing that gets saved into x. In the second, it’s only the original thing that gets put into the variable, and the changed thing is thrown away.
It’s the result of play that you need in the variable (just as in the math example, it’s the result of + 2 that you need to assign).