Bill Allombert on Thu, 14 Dec 2017 23:28:40 +0100


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: patch: Variable argument is always optional because it can be inferred.


On Thu, Dec 14, 2017 at 04:43:06PM -0500, Sam Steingold wrote:
> Hi,
> 
> There are ~50 functions which accept a variable arg ("n" prototype) and
> everywhere except for the 3 places below it is optional.
> In fact, the underlying C functions accept -1, so these 3 are actually
> optional too.

But they are not optional in GP, so you cannot change the prototype
code, this would change the GP language.

For example, 'subst(x^2+1,,y)' has never been allowed.
And it would not work:

? install(gsubst,"GDnG","mysubst")
? mysubst(x^2+1,,y)
%2 = x^2+1
(instead of the 'expected' y^2+1).

Cheers,
Bill.