From: Lassi Kortela <lassi@lassi.io>
To: 67580@debbugs.gnu.org
Subject: bug#67580: 29.1; Anomaly in cl-destructuring-bind &rest handling
Date: Sat, 2 Dec 2023 02:38:41 +0200 [thread overview]
Message-ID: <d1a42eff-b954-415c-9e60-decf3ade4fbb@lassi.io> (raw)
;; These three return the first value to which `a' was bound, which is
;; probably OK.
(cl-destructuring-bind (a &rest a) (list 1 2 3 4)
a)
;; => 1
(cl-destructuring-bind (b a &rest a) (list 1 2 3 4)
a)
;; => 2
(cl-destructuring-bind (a b &rest b) (list 1 2 3 4)
a)
;; => 1
;; These two produce the anomaly. When the &rest parameter has the
;; same variable same as a positional parameter, and there are at
;; least two positional parameters, then &rest tries to decode the
;; list tail from whatever value was first assigned to the variable by
;; a positional parameter.
(cl-destructuring-bind (a b &rest a) (list 1 2 3 4)
a)
;; error: (wrong-type-argument listp 1)
(cl-destructuring-bind (a a &rest a) (list 1 2 3 4)
a)
;; error: (wrong-type-argument listp 1)
reply other threads:[~2023-12-02 0:38 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d1a42eff-b954-415c-9e60-decf3ade4fbb@lassi.io \
--to=lassi@lassi.io \
--cc=67580@debbugs.gnu.org \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.