From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Miles Bader Newsgroups: gmane.emacs.devel Subject: Re: changing multiple-value calls in emacs code. Date: Sat, 14 Mar 2009 09:21:45 +0900 Message-ID: <87fxhheyxy.fsf@catnip.gol.com> References: <87fxhh5hx1.fsf@marie.gnufans.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1236990191 15591 80.91.229.12 (14 Mar 2009 00:23:11 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 14 Mar 2009 00:23:11 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Mar 14 01:24:28 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LiHfu-0005EO-FJ for ged-emacs-devel@m.gmane.org; Sat, 14 Mar 2009 01:24:26 +0100 Original-Received: from localhost ([127.0.0.1]:42092 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LiHeY-0000Zm-1y for ged-emacs-devel@m.gmane.org; Fri, 13 Mar 2009 20:23:02 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LiHdh-0000N9-ER for emacs-devel@gnu.org; Fri, 13 Mar 2009 20:22:09 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LiHdc-0000JD-Oz for emacs-devel@gnu.org; Fri, 13 Mar 2009 20:22:08 -0400 Original-Received: from [199.232.76.173] (port=45716 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LiHdc-0000Ic-47 for emacs-devel@gnu.org; Fri, 13 Mar 2009 20:22:04 -0400 Original-Received: from main.gmane.org ([80.91.229.2]:46066 helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LiHdb-0004KV-OT for emacs-devel@gnu.org; Fri, 13 Mar 2009 20:22:03 -0400 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1LiHdY-0006KZ-Lv for emacs-devel@gnu.org; Sat, 14 Mar 2009 00:22:00 +0000 Original-Received: from 218.231.175.8.eo.eaccess.ne.jp ([218.231.175.8]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 14 Mar 2009 00:22:00 +0000 Original-Received: from miles by 218.231.175.8.eo.eaccess.ne.jp with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 14 Mar 2009 00:22:00 +0000 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 25 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 218.231.175.8.eo.eaccess.ne.jp System-Type: x86_64-unknown-linux-gnu Cancel-Lock: sha1:1SGmTpni8J3NZEPLQb0cSoAMQU8= X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:109609 Archived-At: Dave Goel writes: > There are a very few places in emacs that do things like > (multiple-value-bind). As we know, this does not in reality use any > m-v facility, mostly it is meant to bind vars to a list, rather than > to a host of values. Indeed, (values-list) is an identity. > > In such cases, the right thing to do would be to change such calls: > (multiple-value-setq (a b) (foo)) > to (multiple-value-setq (a b) (values-list (foo))). In cases where it uses `multiple-value-bind' in that way, instead of adding `values-list', wouldn't it be more clear to just use `destructuring-bind' (since that's what's actually meant)? [The only wart is that you have to add `&rest' to the variable list if there are values to be ignored, wheras. It seems you don't need to actually supply a variable following the &rest though; I dunno if omitting it saves any consing or not... destructuring-bind also does more error-checking of the list before binding, I dunno if that's desirable or not...] -Miles -- Defenceless, adj. Unable to attack.