From: Ethan M. <merritt@u.washington.edu> - 2004-07-19 15:26:52
|
On Monday 19 July 2004 01:35 am, you wrote: > On Sun, 18 Jul 2004, Ethan A Merritt wrote: > > 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. > > And everything you do inside them means you have to handle the > substitution at every single point of the code that actually uses a > string. That's not necessarily a much smaller set of places. It could > actually be a good deal larger. Have you actually tried the patchset? Adding the test+evaluation in one place only, the text-printing routine write_multiline(), already catches a large majority of useful cases. Adding it to the file-open code (not sure exactly how many places that is) would catch most of the rest. The minority of text-printing that does not go through write_multiline(), with tic labels being the prime example, should be converted to do so. That would at the same time address several queries about why some of the current text options don't work for tic labels. I may be missing some major class of possible uses for strings, but it seems to me that about covers it right there. What else did you have in mind? > It could almost certainly all be handled by extending m_quote_capture > to proceed evaluating a string-valued expression. That is the second stage, yes, but the first stage is teaching all the parsing routines to accept something other than a quoted string in all the places they currently expect it. > > Assume for the moment we use % for this purpose. Then the > > documentation would read: > > "<expression>" evaluate immediately, with substitution > > '<expression>' evaluate immediately, no substitution > > %<expression>% evaluate later, with substitution at that time > > I honestly don't see why we need the middle variant. What is the > difference between evaluation and substitution that makes you want > control over each of them independently? ??? That's what we have *now*. You want to remove it? It's the third variant I'm trying to add - evaluation deferred until plot time. [aside: About the only thing I use the existing single-quote mode for is to allow inclusion of double-quotes in the string without having to escape them with backslashes. But I don't think that was the original intent. What else is it useful for?] -- Ethan A Merritt |