Karim Belabas on Sat, 30 Sep 2023 14:33:02 +0200
|
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: bug in simplify_shallow
|
- To: "Ruud H.G. van Tol" <rvtol@isolution.nl>, pari-dev@pari.math.u-bordeaux.fr
- Subject: Re: bug in simplify_shallow
- From: Karim Belabas <Karim.Belabas@u-bordeaux.fr>
- Date: Sat, 30 Sep 2023 14:32:58 +0200
- Arc-authentication-results: i=1; smail; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; d=math.u-bordeaux.fr; s=openarc; t=1696077170; c=relaxed/relaxed; bh=qM0jxUnVfou1s8SZcpboM+ug44oQjscE7PIHxQnrBaw=; h=Date:From:To:Subject:Message-ID:Mail-Followup-To:References: MIME-Version:Content-Type:Content-Disposition: Content-Transfer-Encoding:In-Reply-To; b=MgJaRyloYeE83pn7ok6zTxfIhIiSpYivaEd8msaiVH6QG6yXkKm7eSGI43iVZVB1rTko32tuE0oIWxp4V7b4VDBQTZwa3ISaxzTh6Snosq8uG484+PlDd1wV+ejD5kNYopO728Wok7xiWKh6RKPH9FBRI5dQcQCjNT3uIDceK0Y0xnKnY618jSa4Oogd+nM9J5P25VWlZpx+9LIp/4+CHCoMsSdabsUWE6NVh4Xy5+wHFg60noZxJLxWYlJz1mXM9py98J+Urj3MpU5B8dSm3erDxdjuryiSSXta57uSNxmzw58pWLNZa86I4ip/xibvSuHro/aOaX1RbrRzpwwlr0MY7aCjl2HwZ5PUSFjzfzk/Hr5WUDUvI1D4nu9EVz5UA8X7yTUYEARbbS8MmMxUG7soqgY2gX5ADPOm3FVSsR94P+/rhCw8VUlaEccAGIFqXMiwNGn9qhuFD85VWBc16QCqbxn75A3Se+lKSrWX0/2c91CzBU4sznsG41lJEN0Yo55BiNDsO+1UXGKpG/4A4InsrQnNbsprkU0/9Q7VRueAAopj3OKPWT1l7uR0Q1LNEwlOCuJeCMn+VNrhaXk+ArdhvVx2FeQecaEakzaZrPfku/EAfsOaG0nBEfumOQjAyfePSHFQMOjGn9TAVaQYX8YSh3rByIk29GF3v7E/NdM=
- Arc-seal: i=1; a=rsa-sha256; d=math.u-bordeaux.fr; s=openarc; t=1696077170; cv=none; b=DINP9XYu9cDlOyKumnaITwWgb4Jfb38qlcGIJhVuSHs5/U6dWfAySkz8TeoXkT8atQRuxX/7zTLiDM1KDuIU8kvMjzdTGzHVloo9QwvmXoMTH967kEXmAu88Bt/f297MScOMRT+Sx3SPvY0qnc5YKEZLL3UQ0ILi5eT59ATrTbhyZ8xZi6rIYOL4NuIRBtNNQ23yHQkWizOTyuokYs2o8v0dOmiLYJ3m94Go4xeXSUEdfaXED1jvLERkmapiyFNaOice8Q2de7hNyJHsIVNjCN+giNRPRWHcOj2LTtiSx5XzKQUgY0CIT0jRKDU4McGAiIeZ2oOvFeyny4VLlqkR+4l49Ppik1SB3u/DwuQs53VhgquWZ/Nn+CLZbSDZA1x8PgO3g1czwhvzMw0Yo4WeCunpUlKGq394k91I+ZZ9nw0lkkzk2cD//HfmBB87SrTOke+gU+8DRjrCbuUQt/0VWsl1isgnlNYzKNKgaUSi4MwbKOu6LoF7vkCHuIa9JDUyKyw/V36S96+RZ6nNljEyktR3qZB4+9YCjeseSArbl/Z+sheDR3NnHhpzzYTlLjSmPf2eZJalTMI9Ba3VbcJ0ChJf7RxuWM+k6lo31294MdbjCXNOV6FnCxCMN2CAU6d4R/jQ23q3uuhWh0KwhAMPOHk3JUpmNbEuvLde1mNO1oA=
- Authentication-results: smail; arc=none
- Delivery-date: Sat, 30 Sep 2023 14:33:02 +0200
- In-reply-to: <ZRgGI7a8rEyBJWqU@seventeen>
- Mail-followup-to: "Ruud H.G. van Tol" <rvtol@isolution.nl>, pari-dev@pari.math.u-bordeaux.fr
- References: <1e144fa5-864d-450e-a109-1fac8300bf88@isolution.nl> <CANXmBjzx4t330CnCzz4TzMfPFVVYg+-T7iskqECzh_+_2G2ABw@mail.gmail.com> <ZOoCXdx+VmSoRmML@math.u-bordeaux.fr> <ZOtHFLdXr0FuLCzY@seventeen> <70235df6-488a-412a-b2c6-7c49d5898b99@isolution.nl> <ZOtaInkQQYBBw9C7@math.u-bordeaux.fr> <08b1111d-de4a-47e0-b802-69a5a0c2199e@isolution.nl> <ZRc8Lv0zNlmZW8+K@seventeen> <696e7537-01fd-4ec0-90e6-c02df2cfeca0@isolution.nl> <ZRgGI7a8rEyBJWqU@seventeen>
* Bill Allombert [2023-09-30 13:27]:
> > P.S. In paridecl.h, comparing listpop:
> >
> > void listpop(GEN L, long index);
> >
> > shouldn't these now also be void?
> >
> > GEN listinsert(GEN list, GEN object, long index);
> > GEN listput(GEN list, GEN object, long index);
> >
> > (or does GEN cover that already?)
>
> GP uses listinsert0 and listput0 which returns void.
> I have kept the return value for the C functions.
And in that case, it makes sense: it returns the 'clone' of the input
object, as was inserted in the list, which is not readily available to
the caller.
- GP can't use this information (without lots of precautions).
- passing to these functions an input value which is alread a safe clone
is wasteful since we must first validate that 'list' is an actual list
in which we can insert things (and if not we might have a memory
leak or have to clean up in the error handler...)
The current situation is fine.
Cheers,
K.B.
--
Pr. Karim Belabas, U. Bordeaux, Vice-président en charge du Numérique
Institut de Mathématiques de Bordeaux UMR 5251 - (+33) 05 40 00 29 77
http://www.math.u-bordeaux.fr/~kbelabas/