On Thu, 19 Nov 2009, Sven Schreiber wrote:
> 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...
* 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.
What about the possibility of supplying an optional string
argument? If the user gives a name for the graph, the function
saves it as an icon under that name, otherwise the graph is
skipped?
This still requires activating the "objectname <-" mechanism
inside functions, but that should be possible.
Allin