>
> But this isn't working, it's only saving the gnuplot commands to
> a .plt file, as if the "testgraph <-" part weren't there.
>
> I understand that the inner scope of a function isn't supposed
> to affect the outer scope; however, I think the functionality
> would be useful. But I admit it's probably difficult to get this
> right conceptually, or isn't it?
I'll have a think about it. But to push the question back: Do we
want functions to be able to do this sort of thing? (That is,
create named objects in the user's personal namespace without
getting the user's explicit consent in the form of assigning a
return value.) The question is not mean to be rhetorical; I'm not
sure what's right here.
I agree, it's not clear at all. In a normal function context I'd say it's not
necessary, because you can run a script and in the top-level scope of your script do these
"<-" assignments easily (gnuplot or model table). The problem arises within
the package context, where everything is hidden from the user and should happen
automatically.
Maybe this is stretching the package thing too far; OTOH let me add some thoughts:
* Currently the function is doing *something* beyond its scope, namely writing a .plt file
to disk. And I don't think that's bad, because the automatically chosen name makes
reasonably sure it's not interfering with anything (I hope). Would it be so different
if the function adds something to the icon view, maybe using the same name scheme?
* The main reason I think the functionality is useful is because just having the .plt file
is not nearly as good as having the icon. If I (or a package user) could somehow import
the .plt file easily into gretl to get an icon with the associated possibility of GUI
tweaking the graph, then I would probably rest the case.
thanks for listening,
cheers,
sven