[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: The different results obtained by apply function.
From: |
Emanuel Berg |
Subject: |
Re: The different results obtained by apply function. |
Date: |
Thu, 07 Oct 2021 10:25:29 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) |
> You can get this effect without `apply' with `cl-mapcar',
> and the usual `mapcar' behavior without cl-mapcar:
>
> (cl-mapcar #'list '(1 2) '(3 4)) ; ( (1 3) (2 4))
> (cl-mapcar #'list (list '(1 2) '(3 4))) ; (((1 2)) ((3 4)))
> (mapcar #'list (list '(1 2) '(3 4))) ; (((1 2)) ((3 4)))
While it is easy to say `cl-mapcar' is much cooler with the
aggregate function over multiple sets ... but observe
(cl-mapcar #'list '(1 2) '(3 4)) ; ((1 3) (2 4))
(cl-mapcar #'list '(1 2) '(3 4 5)) ; ((1 3) (2 4))
so same outdata for different indata - non-injective!
--
underground experts united
https://dataswamp.org/~incal