Karim Belabas on Thu, 09 May 2024 17:26:30 +0200
|
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: apply / select are inconsistent on Maps
|
- To: Max Alekseyev <maxale@gmail.com>
- Subject: Re: apply / select are inconsistent on Maps
- From: Karim Belabas <Karim.Belabas@math.u-bordeaux.fr>
- Date: Thu, 9 May 2024 17:26:08 +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=1715268370; c=relaxed/relaxed; bh=sFA2feB4HpwLKytIT0hsEcAbyfv4OJGoARHT6Qn3RiQ=; h=DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: Mail-Followup-To:References:MIME-Version:Content-Type: Content-Disposition:Content-Transfer-Encoding:In-Reply-To; b=iUv0uo36KYqxxZh/dhmDNjU/8sICtAI5kFrSDBc82gK3pEbsP8SRoLPGfT3WAroRBHs7Ejk711H77xXEorvOiQi4c51TMsODa6XyocdnFLv2FGU3YgV9IBUOtDhwDXhHhLpeRmvR57ZAmG7sbNGoIiB/E7OIRJ1OvIW1TL4UKAaxpG5+dLB2V1+JVlGEr1HG3AidZ7jiE+Kb10K8irsDY69ALiOSS6O6tbvLzcDq8l391L4Ij4mkQHkJmxl+d7QHV33XSkXsx59hPfiX0S4YKSeTXaG4cB5ELX2YlNjD2zfIYhSjSnngIqEppISbafNHsM+M1jBJU+WePHUBb4pGjqbRkcoxI4YITkiJiPP4KOBUuc9cD2ruFh5Hil6KXaRPfoc6B7hd8619j+/rrmrCSdbGWymtM3fH41VGJgCcy8CfB6rdiz5hkjjixeF7HFluyR1aEZ7MbrhwiHaVqGFPK3TRG/4eqIgpgdcLbFpWo80KTI9P8bvZuoqxtoCraJnr+I0OJIK78XW+mgGXfwUfx/Thkva9vismWtBTvJ9LNz39FsC6qeMg6BJTg7H/tljSfDK9Z1hKBu/qwXFIIi9Ry0yEwkDN9+obdxOkSnd+3cNS64hte48uJWvwuEwYRa5oyOncnJD9DOdJ/lBi+uoTXCc8nNxSxlVFeoDRmssrb7E=
- Arc-seal: i=1; a=rsa-sha256; d=math.u-bordeaux.fr; s=openarc; t=1715268370; cv=none; b=p6rEpPtrzV4X8iUwWrAPlXSSg5Tmzpui5TcymdVB9F6waaCx9Pq/25dBEF2D0Ulv4rYpeADrvxpqBm7VDa9tFcyqK/Ta6jjMYwos/ladaEYyLMOCy6hNLkrms3uEfM2z+htmyYU9TiFW2moCd2bCdhKhfHvcfMFSJH/O+kHFyL2RwEg3+8a3u8Xh8elQs24HnY5VpOlSmc1YNwIlt5VMIArFXanxPBst+cpUYy7zRMtoWImlhxW0lFu5J4mcQ+tZf91EAJANRwYjRcXTmPyprLCCDlMAMF1YNh1KGukAiL3MQDWZdoTHX5aRYSWflHupYNFTYOMDJtxhXlqAoHnVEhukKo34ZRJpO8i7EGVD+VVhFiG4f+guKvxR16iSjXyBp7BmUBsPN6WDpyLKSfzgkIamXPqA28kTymXoxp/e+goj+mQnu5PfF0dhvj3MiBwtfJVebfYAMhDcTYk5kHsYgETjfHZKJHKtvc2m7MldoRqDun4QG5LNhrG+2EXFeAipikk9CAWRZgCw2y3jr/CTRhlzRbAu/5uYqcriyqHRJE5wLMFqAQV0zDClS7QbQM/klGEEaFidb08lB8aKoOUKIxt9B4XGA+63DIsr9sJEebe8pdNF/nbdvy+5HYJ9Q7aQ3ysBjcAQcrjq2y2VSfBXQkdmRT6uWOD11ErFm5Fuhcw=
- Authentication-results: smail; dmarc=none header.from=math.u-bordeaux.fr
- Authentication-results: smail; arc=none
- Cc: pari-users@pari.math.u-bordeaux.fr
- Delivery-date: Thu, 09 May 2024 17:26:30 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=math.u-bordeaux.fr; s=2022; t=1715268370; bh=sFA2feB4HpwLKytIT0hsEcAbyfv4OJGoARHT6Qn3RiQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=U3YJGRj9lotJQbUauj4Kpzi7di31femtFtRuu5+lprYsnFC6fRu5qlYzwfZKp2BjO 1H344Yw4SZjBOLEfvQ7vSH0td0VUYgSBa5fX6T1aghAjiMWVEpojQD5K2A5SPjWZyB 4uuPIpJlOi1x8i0yd2cV/dpku9RxPdRYS4MdRSKMUbl3Pxo3U4kK4/rLhat5SK4AKu B3sIT9DREabnJ2d0G4GKklgiN0maYbIF5rOujr2JwrSVBCU4Y0ErSKiQWVfQKEfblr vseLUEeMDPrQKQacmy+PWtaduM56YCvR9Cm5pYuseL+3K4c8rlRWp+lJPb9azPGEC9 oTqiKJ32wXhKRd8u7YYYQDnQN4MPe5MwFiPY6cToGTv+ifyHH4rD/8LZFS1imG+9uv eWx1iq8jr94rAyPbrKFERqqtxuGXjRCq745GFjw6sUnkZwNpjJjkaWOXy5qWSxcmQC zEAn0VM1/0zB856+W8ceQdjVH/mQzKp81dg2K04hclioHnBTSRYJBWnKnn/k6q2O5Z tlIA83yjbLxFf0zNQmMe39XauN82kSxrU2N7i/Ey2y24yYV6sGHxG7i0tRTX+B7Tgp K4+PUKWBY53ksAsmPEIrj89mGLHAoitEWBoVeu/hvi4FK5vezA3UzCIBo6QMWTXQhY RF3STfJimJ1xy8/0L1wU3w5Y=
- In-reply-to: <CAJkPp5O0RdYjvGdotU43A+jzHEkNziDr1SywNoyxrr40J7qNQw@mail.gmail.com>
- Mail-followup-to: Max Alekseyev <maxale@gmail.com>, pari-users@pari.math.u-bordeaux.fr
- References: <CAJkPp5O0RdYjvGdotU43A+jzHEkNziDr1SywNoyxrr40J7qNQw@mail.gmail.com>
Hi Max,
* Max Alekseyev [2024-05-09 16:39]:
> Hello,
> The following example shows that
> (i) apply() and select() disagree on what is argument of the function when
> applied to Map; and
> (ii) select() produces List rather than Map as a result.
Undefined behavior: select() is not documented to apply to maps.
(In fact, it somehow applies because maps are internally implemented as
t_LISTs.)
select should just throw an exception on this input.
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/