unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#26440: seq-mapn fails with circular sequence
@ 2017-04-11  8:12 Phillip Lord
  2017-04-12  8:22 ` Nicolas Petton
  0 siblings, 1 reply; 4+ messages in thread
From: Phillip Lord @ 2017-04-11  8:12 UTC (permalink / raw)
  To: 26440

On Emacs-25 circular structures cause seq-mapn not to terminate
although the documentation suggest that they should.

Consider:

    (defvar l '(a c d))
    (setq l (nconc l l))
    (seq-mapn #'cons l '(1))

This should return '((a . 1)) but actually does not terminate.

The problem is caused by call to seq-into which includes:

    (append sequence nil)

The problem does exist on trunk which does this instead:

    (if (listp sequence)
        sequence
      (append sequence nil)))








^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#26440: seq-mapn fails with circular sequence
  2017-04-11  8:12 bug#26440: seq-mapn fails with circular sequence Phillip Lord
@ 2017-04-12  8:22 ` Nicolas Petton
  2017-07-31 11:34   ` Nicolas Petton
  0 siblings, 1 reply; 4+ messages in thread
From: Nicolas Petton @ 2017-04-12  8:22 UTC (permalink / raw)
  To: Phillip Lord; +Cc: 26440

"Phillip Lord" <phillip.lord@russet.org.uk> writes:

Hi Phillip,

> The problem does exist on trunk which does this instead:

Did you mean "does not exist"?

Cheers,
Nico





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#26440: seq-mapn fails with circular sequence
  2017-04-12  8:22 ` Nicolas Petton
@ 2017-07-31 11:34   ` Nicolas Petton
  2017-08-01 18:40     ` Nicolas Petton
  0 siblings, 1 reply; 4+ messages in thread
From: Nicolas Petton @ 2017-07-31 11:34 UTC (permalink / raw)
  To: Phillip Lord; +Cc: 26440

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

Nicolas Petton <nicolas@petton.fr> writes:

>> The problem does exist on trunk which does this instead:

This is using seq.el from trunk:

  (defvar l '(a c d))
  (setq l (nconc l l))
  (seq-mapn #'cons l '(1)) ;; ((a . 1))

Cheers,
Nico

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#26440: seq-mapn fails with circular sequence
  2017-07-31 11:34   ` Nicolas Petton
@ 2017-08-01 18:40     ` Nicolas Petton
  0 siblings, 0 replies; 4+ messages in thread
From: Nicolas Petton @ 2017-08-01 18:40 UTC (permalink / raw)
  To: Phillip Lord; +Cc: 26440-done, 26440

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

Nicolas Petton <nicolas@petton.fr> writes:

Hi Phillip,

> This is using seq.el from trunk:
>
>   (defvar l '(a c d))
>   (setq l (nconc l l))
>   (seq-mapn #'cons l '(1)) ;; ((a . 1))


I'm closing this issue, but feel free to reopen it if you can reproduce
the problem with master.

Cheers,
Nico

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-08-01 18:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-11  8:12 bug#26440: seq-mapn fails with circular sequence Phillip Lord
2017-04-12  8:22 ` Nicolas Petton
2017-07-31 11:34   ` Nicolas Petton
2017-08-01 18:40     ` Nicolas Petton

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).