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


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/