Vincent Lefevre on Mon, 12 Aug 2024 11:54:21 +0200


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

Re: Wrong error message from 2u


On 2024-08-11 23:48:38 -0700, Ilya Zakharevich wrote:
> In
>   (23:29) gp > my([a,b,c]=[(u-v)^2,2u*v,(u+v)^2]); c^2-a^2-b^2
>     ***   syntax error, unexpected variable name, expecting ',': ...,c]=[(u-v)^2,2u*v,(u+v)^2]);c^2-a^2-b^2
>     ***                                                                                      ^--------------
> 
> the arrow points at the second closing bracket.  The actual problem is
> 2u.

The issue seems to be the "expecting ','" (and the position of
the arrow is a consequence). Why "expecting ','"?

Simpler testcase:

? [2u,3]
  ***   syntax error, unexpected variable name, expecting ',': [2u,3]
  ***                                                               ^-

-- 
Vincent Lefèvre <vincent@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)