From: Hans-Bernhard B. <br...@ph...> - 2004-07-18 21:35:53
|
On Sun, 18 Jul 2004, Ethan A Merritt wrote: > But that example does not require a user-defined function. > That is the behaviour you would get anyway, courtesy of > the automagic string evaluation code already written. > > filename = 'sprintf("foobar%d.ps",i)' > set output filename If that indeed works, and recomputes the sprintf every time the 'set output' command is reissued, then by comparison with existing gnuplot machinery for user-defined objects, 'filename' is a function, not an variable. So far, the gnuplot paradigm always was that variables have a static value (unless they're the dummy in a plot command, i.e. 'x', 'y', 't', ...). I.e. so far, variables stored values, not expressions to be evaluated at some later time. If at all possible, I'ld like to keep it that way for strings, if only to minimize the amount of documentation we and the users will need to fully explain all this. > They would need to check that the string is > not really a constant, but instead holds a sprintf() command. I'm opposed to having sprintf() *inside* the quotes. It causes new problems like the '' vs. "" saving issue that we don't really need, for no real gain. -- Hans-Bernhard Broeker (br...@ph...) Even if all the snow were burnt, ashes would remain. |