On Wed, 19 Apr 2017, Sven Schreiber wrote:
Am 19.04.2017 um 22:20 schrieb Riccardo (Jack) Lucchetti:
> On Wed, 19 Apr 2017, Allin Cottrell wrote:
>> OK, fixed in git. But I wonder if, for use in this sort of
>> context, we might want a more syntactically robust way of
>> defining a list (as opposed to "space between series IDs = list
>> concatenation").
Yes indeed, I think in the spirit of gretl/hansl it would make
sense to allow the space-separated list definition only in the
context of gretl commands. However, of course there's a
bigger-than-average compatibility issue there if some current
usage would be disallowed. Introducing something like deflist()
and make that the recommended way would probably be a good
compromise.
Yes, I think that's the way to go; the old "space-separated series"
approach to defining a list will still be acceptable in all contexts
to the extent we're able to support it, but we can now recommend the
alternative deflist() method for contexts other than "commands".
>> list hey = big ? x : deflist(x,y,z)
>
> This would be very nice. Perhaps deflist() should take lists as
> well as series as arguments.
That's now in git and snapshots. deflist() takes as many arguments
as you like: each argument should be a named series (given by name
or ID number) or a list (a previously named list or a suitable
expression).
Indeed it would be nice also to build function list arguments
on-the-fly, so instead of:
<hansl-now>
list tobeinput = x y
mylistargfunc(tobeinput)
</hansl-now>
this:
<hansl-future>
mylistargfunc( deflist(x, y) )
</hansl-future>
The future has arrived ;-) Actually we get this for free, given the
way hansl works. Here's a (contrived!) example:
<hansl>
function void lfoo (list Li)
list Li print
end function
open data9-7
lfoo(deflist(1,2,PRIME,log(deflist(STOCK,POP))))
</hansl>
Allin