Bill Allombert on Mon, 20 May 2024 19:04:30 +0200
|
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: apply / select are inconsistent on Maps
|
- To: pari-users@pari.math.u-bordeaux.fr
- Subject: Re: apply / select are inconsistent on Maps
- From: Bill Allombert <Bill.Allombert@math.u-bordeaux.fr>
- Date: Mon, 20 May 2024 19:04:13 +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=1716224655; c=relaxed/relaxed; bh=sI6FbDoRU6X7xwWfHBPO9TfYMEJijB9X/z9GxMpG/9U=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:Mail-Followup-To: References:MIME-Version:Content-Type:Content-Disposition: In-Reply-To; b=m+dO3nDR77NDEckk5eq2XjQ5sbV+g6Pmx+W0oHQb7iSDbDbCZQfzfU6DgGmLNh77MiUCw0QEVwp63T7rl7T9u1YZTae9UUbYIuQ8G9FC2pw/WG80X0gPRTJKhcr6vnvy2QGeV1bZczkUvtb7j2LSmNC03DbN+6OY1ZP+1EfFmtulGKVLT2nfR6HmS5Z1ePPJlHolYklXYKzNiQvqVNhPfbYo3j4MhygugJxGpqbv03lpVTzYSgbfViydMyneXFBcRGsVHSyW2yb2xADRqRyLZkqGEQISFViK9i5WfwlW0JA5XWqHrEgzjnKnKd+TT88tEtBUSfyly0NOYrhmjJgtxA5zNY5Lrn72JkU4jh0p8Zc9ZMCfGXGCzYAq95a2ygojqMfAlU01IhS2O8GTJY2JXbBH2lX8Rwl174yt5FWmRlcFwFjN82a33iLUrTeF0jJ1w6fKS8GIYRuEUlJWxurKPEGXY8WjMopbWihKEm2g5hW3VOfnpgLouaSn9locjGCvDvRys5kODDG/ujeTXb76XHdglt/W5S+eb71fKfqY+IwVsrmNJnuLVEEa2zODX8x7IHAkZlVKbRc50wRjdEfdSW96U3gsd6+5+fvklAxgue+Uoda0Cj0zLomECEq4tO4LmmQrRpAbZ30GIAlrAfCXkvyBXBSGC4WZxh8LusT8rRE=
- Arc-seal: i=1; a=rsa-sha256; d=math.u-bordeaux.fr; s=openarc; t=1716224655; cv=none; b=LT+sAcDksUkHURAQvxiZ8AmnIqKKFNesLp3xCJee/+nozaISdNGGCnxbWFsnj4EIY7yR+Ndbf0F11zhchwwd86LcSQRjR7GSH3B8rYQS2tg98ZKe/q6Dylar9zpS48K1ZBivWndvN4TcAH0NWwYoFhKn4H4Z525GzzsTN9oDZjdnzmfIj1bzEjWN8MShVi0plnPe2lR3DTWJK4q67HdhJjat3L04Dp/cmGvTruXaZAsAbnwD3rIh4I5pDIe48ggJ91L0b4U+n0/JdCQmX3K+u7xgMFBXASVFHsiX2Zb9wuNo1yIMv0R5r5bzWfxWIJYyBhIej5dDvam28xZuo6pwmEl5GC+nJ0VgylZLIlpM1IiSHnK9l2n8/zFcYMItIRS3XEXOsPqvfgfOXsi9YaXBEORO7YXZJySkEy9qt/Mv9GLFW2mMJonjwVXk4QhVdS0saVYvbf0j7+O4HzYdviaz7i0H6m8OJqiobCDRBARABUR99b61qATg5I9wC+ZlJQKTbKRLgkpi4zgPXwMW4KvTOiFsX4Y8Rep5LBX7ZR5836qFBO6m/j1b+kbuaii/fghpl7ya+0yz2wRO2405S7zeY7UYsPO2Y3LcwWQJZRiuOmYVByYp7DxGElynqUN3dwKai0vjFsUb3oii1MJj8auar2Xp5kUKnEb4dLlCMBAEzAU=
- Authentication-results: smail; dmarc=none header.from=math.u-bordeaux.fr
- Authentication-results: smail; arc=none
- Delivery-date: Mon, 20 May 2024 19:04:30 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=math.u-bordeaux.fr; s=2022; t=1716224655; bh=sI6FbDoRU6X7xwWfHBPO9TfYMEJijB9X/z9GxMpG/9U=; h=Date:From:To:Subject:References:In-Reply-To:From; b=JfKHj+kHZ7Q0/zDxZm7eaU6qaYnPNV9vLijywnFZ3Nb4L7w1g5KYCpjXpXOgUjIVA vsLZuotnH64RHuUma1eyx6+iE0iHP8GGi6Vmzdn0O73PlBkUUqOmpxrFB55OUALpx+ cQvymaRklRFBK91p4XRHAcM9SL4jARO+TrEXMyvFk0Yki17YuNjBCBeEFrjr26oNlS nnWDYtTmt9wRB22aiQkXwhsa6Rnyd8kvYsWHCJ3zc5wPdeMQkfbyIygYqbFfHbTqM9 zCFvFZRubMyDBnHXN7+6wNLY2AYwQcX78YPo1ekm3o1Wsl3jseO0pDK4XAzmiKhWDZ XopF1ZruSzG4LbcsMJL6tSFqsYQMt+iiUdcvvgHTS6vWMoBcEwJ/6kJFcrOEr0T+L6 OCPWFkzhs9ioFagANttLukwlJ/CroDidOnS5CLqGa37lmV8H+iyKYo8DPKmHUw4fai 0Dd42YhCmv3yjFdQQEWXI50p076xfA/CmxlRm90k3n+69tioIEJQptPSozbfsK6dgP sn/N1SchlSdQmbyr190cHyqMifXMBmMXmYiT5SUyXHprPfpESextL3Pyb2obVpnb/v 6uUSrrcowZX+kJNSE8NkxP48YQ6unacgr3FMFfuBULZB2CeSZGTMulQZwk2K7cm3M4 PHA2v/dqD5dDgGEBVs1cIUv8=
- In-reply-to: <CAJkPp5O2jGJKFiq=3cP+NMHV7cMmZQVB2YUHF38LsP5-og6sdw@mail.gmail.com>
- Mail-followup-to: pari-users@pari.math.u-bordeaux.fr
- References: <CAJkPp5O0RdYjvGdotU43A+jzHEkNziDr1SywNoyxrr40J7qNQw@mail.gmail.com> <ZjzrEESV1EkQ491B@math.u-bordeaux.fr> <CAJkPp5O2jGJKFiq=3cP+NMHV7cMmZQVB2YUHF38LsP5-og6sdw@mail.gmail.com>
On Thu, May 09, 2024 at 12:17:18PM -0400, Max Alekseyev wrote:
> Hi Karim,
>
> But why not extend the functionality of select() to Maps, just making it
> consistent with how apply() works?
OK I have implemented select for t_MAP.
If flag=0, it returns a MAP if flag=1, it returns the list of keys.
M=Map([1,2;3,4;5,6]);
select(x->x%4==2,M)
%2 = Map([1,2;5,6])
select(x->x%4==2,M,1)
%3 = [1,5]~
Cheers,
Bill