Loïc Grenié on Wed, 11 Nov 2015 09:18:29 +0100 |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: Vector of args |
On Tue, Nov 10, 2015 at 12:31:51PM +0100, Loďc Grenié wrote:
> I think I agree with Kevin. It would create a discrepancy between
> command-line and call(). If f has 3 arguments then I must call it
> with f(1,2,3) in the command-line and call(f,[1,2,3]) in a function. If I
> upgrade later f to a variadic function, the command-line remain the
> same: f(1,2,3) but I must change the call to call(f,[1,2,[3]]).
If you change
f(a,b,c)=....
to
f(a,b,c,d[..])=....
and then call(f,[1,2,3]) will still work
If you replace a fixed arg GP function with a variadic GP function, lots of
things will stop working, not just call(). Variadic GP functions were not meant
to write replacement for fixed arg user functions, but to write replacements for
built-in variadic functions, like printf.
This proposal makes it harder to use call inside a variadic function, which is
an important use case.