Sam Steingold on Thu, 14 Dec 2017 23:40:33 +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.


> * Bill Allombert <Ovyy.Nyybzoreg@zngu.h-obeqrnhk.se> [2017-12-14 23:28:37 +0100]:
>
> On Thu, Dec 14, 2017 at 04:43:06PM -0500, Sam Steingold wrote:
>> 
>> 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.

Why not change it? ;-)

> For example, 'subst(x^2+1,,y)' has never been allowed.

Why?  It seems like 'x' can be inferred.

> 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).

Indeed, I tested only taylor and assumed that it would work elsewhere
too.  In fact, it works in serprec but not in subst.
Sorry.

1. Could you please apply the patch to the taylor and serprec?
2. Could you please fix subst? (Or would you rather have me try?)

Thanks!

-- 
Sam Steingold (http://sds.podval.org/) on darwin Ns 10.3.1504
http://steingoldpsychology.com http://www.childpsy.net
http://www.dhimmitude.org http://americancensorship.org https://jihadwatch.org
Why do you never call me back after I scream that I will never talk to you again?!