|
From: Ethan M. <merritt@u.washington.edu> - 2012-01-20 20:17:41
|
On Friday, 20 January 2012, pl...@pi... wrote: > On 01/20/12 20:29, Ethan Merritt wrote: > > I gave two examples where this is (I think) the correct thing > > to do, but I can easily imagine that there are other cases where > > it is not necessarily the best thing to do. Perhaps being > > inside an iteration loop is one of these cases. > > The two examples you gave make sense. this has been the case previously > and works well. > > The iteration loop would probably create equally unexpected results if > it started doing full evaluation. All I was suggesting is that the > substitutions that are made by iteration are also applied to the title > > plot "datafile1", "datafile2" , "datafile3" > > creates a legend > > datafile1 ------- > datafile2 ------- > datafile3 ------- > > I am suggesting that > > plot for [i in "1 2 3"] "datefile".i > > does the same instead of: > > "datefile".i ------ > "datefile".i ------ > "datefile".i ------ But how do you suggest that the program would do this partial evaluation? There is no mechanism for saying "evaluate this expression only to the extent of terms that involve a particular variable". I understand the issue you are raising, but I still don't think it has anything in particular to do with iteration. If you say (no iteration) i = 3 plot "datafile.".i then the autogenerated title is not 'datafile.3', it is '"datafile.".i'. That's probably not what you want, but how is the program to guess this? In the equally plausible case File(x) = "datafile.".x plot File(3) then the autogenerated title "File(3)" _is_ what you probably want. So in one case you want evaluation but in the other case you do not. How can the program distinguish the two cases automatically? Ethan |