On Sun, 1 Feb 2015, Riccardo (Jack) Lucchetti wrote: > On Sun, 1 Feb 2015, Allin Cottrell wrote: > >> [...] As things stand, the "append" command should not be allowed >> within a function. This is because for append to work correctly >> the full dataset must be "in scope", but inside a function it's >> not: only such variables as have been passed as function >> arguments are "visible". > > This is possibly the most confusing aspect of Hansl for people coming from > different backgrounds. [...]
Yes, sorry about that. But as Jack goes on to say, it's a deliberate design decision that's not going to be changed. However, there are idiomatic ways of adding series to a dataset via a function. One way is to use the "join" command in the function. This adds a series as a local variable within the function; it can then be passed to the caller as a return value. Take a look at Jack's yahoo_get function package for some ideas. As for the crash Thorsten got, that's now fixed in CVS and snapshots: attempting to use "append" within a function will provoke an error (as does "open", which has always generated an error -- but when we banned "open" originally we overlooked the need to ban "append"). Allin
