Bill Allombert on Mon, 16 May 2011 18:55:18 +0200


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

Re: Bug in apply?


On Mon, May 16, 2011 at 12:26:06PM -0400, Charles Greathouse wrote:
> apply(Str, [1])
> fails in PARI 2.4.4 in both Linux and Windows (using the latest SVN
> version).  apply(s->Str(s), [1]) works as expected.

This is actually a compromise for compatibility with GP 2.3.
Under both versions:
? Str
%1 = ""
so your statement is equivalent to
apply("", [1])
which is invalid.
The issue exist with any built-in GP function that has no mandatory argument and
at least one optional argument.
Other examples include Vec, random, etc.

Cheers,
Bill.