From: Dave D. <dde...@es...> - 2004-07-21 10:44:49
|
Ethan A Merritt <merritt@u.washington.edu> writes: >> 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. > > I disagree, and I think the record of requests for enhancement > support me on this point. People really want a way of embedding > variables into strings, and having the current value of the variable > substituted in at the time the string is printed. It doesn't matter > whether you call that "re-evaluation of a string" or "storing a function > instead of a string", or "storing an expression to be evaluated later", > that is the desired capability. > There is a demand for some way of making a plot with labels showing the current value of a variable. I don't think this necessarily translates into a need for dynamic substitution at plot time. (But I think that point has already been made) >> 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. > > On the contrary, it's a huge gain. It means that a very powerful > ability is introduced in a uniform way, yet requires minimal or no > change to the existing code or to the existing storage mechanisms > for strings. > > Anything you do _outside_ the quotes means that every single place > that tests for a string constant has to be re-written to handle the > possible substitution of other syntactic entities instead. > In any big program, there comes a time for refactoring. It seems to me that, at the start of a development phase, the fact that a feature can be inserted with minimal code impact does not *necessarily* mean it is the best way to do it. (And even at the end of a coding cycle, it may still be better to leave it out than to distort the syntax or limit the future possibilities. I'm speaking generally here, not about this change in particular. On the subject of requested features / large changes... is there a case for introducing array variables which can be read from a file ? Or is this starting to tread on octave's territory ? Loading up a file as a 2-d array of strings (which can be converted to numbers), and being able to plot from an array, may unblock a number of problems. dd -- Dave Denholm <dde...@es...> http://www.esmertec.com |