unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: akater <nuclearspace@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org
Subject: Re: [PATCH] Add cl-map-into, revision 2
Date: Thu, 07 Oct 2021 08:24:32 +0000	[thread overview]
Message-ID: <87mtnlqm2n.fsf@gmail.com> (raw)
In-Reply-To: <83o8811ex5.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 1447 bytes --]

Eli Zaretskii <eliz@gnu.org> writes:

> Is there any reasons you excluded other kinds of sequences (strings
> and bool-vectors)?

I forgot strings aren't vectors in Elisp (I rarely deal with vectors).

Both strings and bool-vectors are arrays so I could simply replace
vector with array wherever it matters.  This would include char-tables
too; I don't have experience with those.

But it is conceivale that Elisp might get arrays that are not sequences
in the future.  E.g. CL has multidimensional arrays.  Elisp manual
mentions “all [currently defind types of array are] one-dimensional” so
the notion of multidimensional array is recognised already.

It thus would be nice to have a special type for one-dimensional array.
In CL, it's precisely “vector”.

Anyway, I don't hope this type will appear soon so for the time being
I'll just replace “vector” with “array”.

>> +  (should (equal [42 42 42]
>> +                 (let ((s (vector 18 19 20)))
>> +                   (cl-map-into s #'+ s '(6 4 2 1 not-even-a-number) s)
>> +                   s))))
>> +
>
> I don't see here any tests where the lengths of the sequences are
> different.  Can you add some of those?

Lengths are different in the last test.

But it reminded me that I should add an example with a circular list.
After all, this is the case where current implementations of cl-
mappers break (for 3 arguments and beyond).

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 865 bytes --]

  reply	other threads:[~2021-10-07  8:24 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-23 23:35 [PATCH] Add cl-map-into akater
2021-09-27 17:18 ` Stefan Monnier
2021-09-29 19:30   ` akater
2021-09-29 20:26     ` Stefan Monnier
2021-09-30  6:38       ` Bozhidar Batsov
2021-09-30 13:03         ` Adam Porter
2021-09-30 13:09           ` Bozhidar Batsov
2021-09-30 13:21             ` Adam Porter
2021-09-30 15:00               ` akater
2021-10-01 18:40         ` Stefan Monnier
2021-10-01 18:51           ` Eli Zaretskii
2021-10-01 19:04             ` Tassilo Horn
2021-10-01 20:52               ` Stefan Monnier
2021-10-01 22:08                 ` Glenn Morris
2021-10-02  3:53                   ` Stefan Monnier
2021-10-06 23:35   ` [PATCH] Add cl-map-into, revision 2 akater
2021-10-07  7:18     ` Eli Zaretskii
2021-10-07  8:24       ` akater [this message]
2021-10-07  9:00         ` Eli Zaretskii
2021-10-09  2:46       ` [PATCH] Add cl-map-into, revision 3 akater
2021-10-13 22:32         ` Stefan Monnier
2021-10-26 12:52           ` akater

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87mtnlqm2n.fsf@gmail.com \
    --to=nuclearspace@gmail.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).