Karim Belabas on Sun, 27 Aug 2023 16:18:37 +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>
- Subject: Re: bug in simplify_shallow
- From: Karim Belabas <Karim.Belabas@u-bordeaux.fr>
- Date: Sun, 27 Aug 2023 16:13:54 +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=1693145626; c=relaxed/relaxed; bh=WSQb3JZg7CRYsicXjP4swv3VIdA0lgofF7jklSSVVmg=; h=Date:From:To:Cc:Subject:Message-ID:Mail-Followup-To:References: MIME-Version:Content-Type:Content-Disposition: Content-Transfer-Encoding:In-Reply-To; b=OuYVx6cwmBSKggb3zvDV2w5qljLU4g1WEGpt4fR/Zms+BU2bkhdhsc1E5RxhQdIjbB+fwzhD8xEDRuJOcBgq7BVCUqe+abHDXcMbURmm74F1wQ4cbOB//2MfxKesAoWoPG0vktODlyry7bxfRbRxl0Iq+n7/GMD/uBc9n33h/mJYcfu8KIQi2h1O+cFYFMRlti5aQGo0tzs9FBVUJXUmcElBbZgXUY6kXLFOWM80ex3XHWk3OreXTiTq4I+kh/BDCHHW5YMZnvZepi2Ul46XAnkQmBbodW9lml8jTE1F0yxOJsrSPA8Pu95SGYiDmZVgIvlQslyce9GpleO94tlb7zQ6XfBkqZxgCz6eSJHDMqivj35lfMprMkqVqcPe2OvNg7IW1bQs/lL+nWzvVKt12brMUyvWIyblOcXQ4CBj3ZhuiS0llJ7NK3ur8nqlSBWRZTGMHhVebbammY3Ic7mFPyZnFJ5i8Fo3QKfZaku2sxMvsr1bf1g9yt9SEk/hKf7VNXkBn3pDhAX35+FlzPj1q3BoV9jmT7Kii8JE0Fl/8SUj4Kpjqm/osBPK3aSsLhFWNox8lSFDxJVTBuH24E8dUl0/yn6Qh8U480CdwHgB9s1zFWqW5h/PHGTimfp0cY7lcmVu5e8Fm6u5xtDj8KqyWEG+ICCL8z1XIfmRFU1RIO8=
- Arc-seal: i=1; a=rsa-sha256; d=math.u-bordeaux.fr; s=openarc; t=1693145626; cv=none; b=g96F8MGbm5EjxH/mgyAkJXKQNKMEJCXp/z6oUU0O5+MloqClE9of2bhfVD0iJz4r6GctItObuaJBn9i6kqfYYbIudpn7MLeRkio899VGuN8UCd/zqpnqBrn1Ul4G1t7n8F2atUwm1Z0EHVvg0IT31mzkUfarzWK6r6w/dydM5plh6ph7xE1PSnMLho2fPJuzct5I1ulqiUE6u3TuE2IosxK4rdKmhKBPh6EEdFCx2larUlLJCr36V2iPkngH8EmT0lgUMRxtvY04DBSpojgYs7eFuC6zIs4zlPW7vstUjLGCyYp/zMg2Wz4eNdZSsKPisee06HBiVdCzxdp1KdPkgX1v0AQG3dg4RaV+UWsUU92vAxfnRCUWA6SmppaW3KbNnk4WToWi+JEUepuK84ZFkScNPwi6l+rIEcROYySpz5LfEitK+b+m6i/HiOu2WNh5Ysjh2acTKdexwV4ckBgqVD8kfKQm4J54lJukmtL2WvwNQP0JpA8oX+3GqpB9chT93h3CWOvDx8B6+MEZoSzV57j7lfgOTol34/rPqHj8oSWv7g3fw9akLteonwktQc43Ct8PRNKMQ3MPfwZ8/V+QhI1MNlg3G8SRA8T4ya7LnyqQr+OunqwEVMxvu57IdNMCzqN1SEGqXBNs4OAHJ5FDFpPsVx+9wWj6KfHhNJyyo6w=
- Authentication-results: smail; arc=none
- Cc: pari-dev@pari.math.u-bordeaux.fr
- Delivery-date: Sun, 27 Aug 2023 16:18:37 +0200
- In-reply-to: <70235df6-488a-412a-b2c6-7c49d5898b99@isolution.nl>
- 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>
* Ruud H.G. van Tol [2023-08-27 15:42]:
>
> On 2023-08-27 14:58, Bill Allombert wrote:
> > [...]to be honest I did not remember that listput returned x and it is
> > not explicitly documented
>
> ? ??listput
> listput( list,x,{n}):
>
> Sets the n-th element of the list list (which must be of type t_LIST)
> equal to x. If n is omitted, or greater than the list length, appends x. The
> function returns the inserted element.
>
> So "returns the inserted element".
What "the inserted element" means is ambiguous in the context of PARI's
memory model. What the implementation does is return a direct pointer to
the new list entry, that inserted element being a clone of the input x.
What Bill and I suggested was to return "a copy of the inserted element"
instead. I don't really see a scenario where this would break
compatibility ... except this would make insertion about twice slower,
even in cases where the returned value is ignored.
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/