Bill Allombert on Sat, 18 Jan 2003 21:01:44 +0100

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

Re: gp: divrem(1+O(2),1+O(2)) forbidden division

On Sat, Jan 18, 2003 at 02:48:38PM -0500, Michael Somos wrote:
> pari-dev,
> ? divrem(1+O(2),1+O(2))
>   ***   forbidden division t_PADIC \ t_PADIC.
> Isn't this message misleading? It is perfectly possible to divide
> two padics. Perhaps a better choice of words would help here. Shalom,

Did you see the '\' ? it is not a '/', and 
? (1+O(2))\(1+O(2))
  ***   forbidden division t_PADIC \ t_PADIC.

In fact divrem is mainly a call to '\' (gdivent) so they 
output the same error messages.

To clarify : I agree that GP error messages would be more useful
if they told about the GP function involved instead of the PARI function,
but it is difficult to implement, please so take some of our answers not as
'we do not want to fix it' but as 'we are unable to fix it', sorry.

Maybe the parser can store a global pointer to the name of the function before
calling it (at src/language/anal.c:1980) , and then err() would print

 ***   forbidden division t_PADIC \ t_PADIC, in function blah.

if the pointer is not NULL.

It would be far better to give the context of the error (with a
---^) but it is much more difficult to implement.