|
From: Juergen W. <wie...@fr...> - 2004-10-14 18:40:38
|
Am Mittwoch, 13. Oktober 2004 20:15 schrieb Ethan Merritt: > > I was expecting more feedback, but maybe "no news = good news". > > Yes, the core code can probably go into cvs. The add-ons > > should get more discussion. I'll start separate threads for > > each. > > This is a re-implementation of the "userstrings" patch I made > quite a while back for version 3.8 and still available for 4.0. > I know people are using this, because they send me Email. > > The only issue raised about the earlier patch was that it > used the symbol "$" for a new purpose, possibly causing > confusion with multiple existing uses. So for this new version > of the patch I have substituted the symbol "@", which is not > currently accepted by the gnuplot parser at all. > > Syntax: > myformat = " 1:2:($4-$5) with lines lt palette" > plot "foo" using @myformat > > The parsing code performs a string substitution before > interpreting the command line, yielding > plot "foo" using 1:2:($4-$5) with lines lt palette > > Since @ was not previously legal at all, I can't think how > this could break any existing scripts or usage. > But as always, comments are welcome. It can break scripts because macros are evaluated in "!"- and backtic shell commands: gmx = "foo" print `echo us...@gm...` ! echo us...@gm... While the latter doesn't seem to be useful (you can use the system command instead) the macro expansion in backtics might have some use. Consider file = "input.dat" value = `some-command @file` I would really appreciate this functionality. But it is some kind of inconsistent that value = `some-command "@file"` wouldn't work. You would have to kludge backticcommand = '`some-command "' . file . '"`' value = @backticcommand On the other hand, if you really need the "@" in the backtic command, you would have to count the quotes. This isn't really intuitive. That said, I think this patch is a small change which clearly extends the power of gnuplot. Juergen PS: Just curious: Is there a reason that string_expand isn't called from within scanner just like substitute? |