unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: akater <nuclearspace@gmail.com>
Cc: 51412@debbugs.gnu.org, Stefan Monnier <monnier@iro.umontreal.ca>
Subject: bug#51412: 29.0.50; cl--mapcar-many fails inconsistently in the presence of circular lists; other shortcomings
Date: Wed, 14 Sep 2022 20:38:45 +0200	[thread overview]
Message-ID: <87leql3ioa.fsf@gnus.org> (raw)
In-Reply-To: <87ee88dmzb.fsf@gmail.com> (akater's message of "Tue, 26 Oct 2021 11:50:00 +0000")

akater <nuclearspace@gmail.com> writes:

> cl--mapcar-many is used as a backend for implementing several cl-
> functions in cl-extra.  To deal with arbitrary number of arguments
> (passed to cl--mapcar-many as list cl-seq), it goes through them all
> whenever there are more than 2, in advance, and attempts to compute the
> minimal length.
>
> This fails if any of the arguments is a circular list.
>
> To reproduce, just evaluate (cl-map 'list #'identity '#1=(a . #1#) nil nil).

Debugger entered--Lisp error: (circular-list (a . #2))

> Note that (cl-map 'list #'identity '#1=(a . #1#) nil) doesn't fail so
> this is at the very least inconsistent.  N.B.: CL spec says “Should be
> prepared to signal an error” for improper lists for such functions.
> Long story short, this means circular lists can be supported by CL
> implementations according to CL spec.

It's inconsistent, so that should probably be fixed.  But isn't
signalling an error here the right thing to do?  But I guess as long as
not all the lists are circular, then it's fine to return something
here...

Perhaps Stafan has some comments; added to the CCs.





      reply	other threads:[~2022-09-14 18:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-26 11:50 bug#51412: 29.0.50; cl--mapcar-many fails inconsistently in the presence of circular lists; other shortcomings akater
2022-09-14 18:38 ` Lars Ingebrigtsen [this message]

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=87leql3ioa.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=51412@debbugs.gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=nuclearspace@gmail.com \
    /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).