unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#23597: 24.5; `cl-values-list' should not be an alias for `identity'
@ 2016-05-22  0:25 Drew Adams
  2019-07-28 12:15 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 2+ messages in thread
From: Drew Adams @ 2016-05-22  0:25 UTC (permalink / raw)
  To: 23597

Emacs Lisp does not support multiple values for its Common Lisp
emulation.  OK, fine.

But that is not a reason for this kind of definition.

`cl-values-list' should at least raise an error if its arg is not a
list.  That too is part of the Common Lisp definition of `values-list':
"Should signal type-error if its argument is not a proper list."

(cl-values-list 5) should not return 5.  It should raise a wrong-type
arg error.

A comment in cl-lib.el says this:

;; cl-multiple-value-bind and friends simply expect the target form to
;; return the values as a list.

It is not enough that `cl-multiple-value-bind' and friends expect that.
They are not the only context in which `cl-value-list' can be used.
`cl-values-list' is a general function on a list, and it needs to check
its argument to ensure that it is a list.

In GNU Emacs 24.5.1 (i686-pc-mingw32)
 of 2015-04-11 on LEG570
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Configured using:
 `configure --prefix=/c/usr --host=i686-pc-mingw32'





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

* bug#23597: 24.5; `cl-values-list' should not be an alias for `identity'
  2016-05-22  0:25 bug#23597: 24.5; `cl-values-list' should not be an alias for `identity' Drew Adams
@ 2019-07-28 12:15 ` Lars Ingebrigtsen
  0 siblings, 0 replies; 2+ messages in thread
From: Lars Ingebrigtsen @ 2019-07-28 12:15 UTC (permalink / raw)
  To: Drew Adams; +Cc: 23597

Drew Adams <drew.adams@oracle.com> writes:

> Emacs Lisp does not support multiple values for its Common Lisp
> emulation.  OK, fine.
>
> But that is not a reason for this kind of definition.
>
> `cl-values-list' should at least raise an error if its arg is not a
> list.  That too is part of the Common Lisp definition of `values-list':
> "Should signal type-error if its argument is not a proper list."
>
> (cl-values-list 5) should not return 5.  It should raise a wrong-type
> arg error.

I agree.

I've gone through the Emacs trunk to see whether tightening up the
definition would lead to any problems, but all the usages are on the
form

  (cl-multiple-value-bind (tree header tree-buffer)
      (cl-values-list (ebrowse-choose-tree))

which would already bug out if what's returned is not a list.

So I've now made this change on the trunk.  In the unlikely case that
this leads to problems with out-of-tree code, we should be open to
reverting it.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





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

end of thread, other threads:[~2019-07-28 12:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-22  0:25 bug#23597: 24.5; `cl-values-list' should not be an alias for `identity' Drew Adams
2019-07-28 12:15 ` Lars Ingebrigtsen

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