From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lawrence Mitchell Newsgroups: gmane.emacs.bugs Subject: bug#11686: 24.1.50; defun should return name Date: Wed, 13 Jun 2012 15:34:09 +0100 Message-ID: <874nqfl1r2.fsf@gmx.li> References: <87ipewb637.fsf@gnu.org> <87mx47h8wp.fsf@gmx.li> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1339598130 20749 80.91.229.3 (13 Jun 2012 14:35:30 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 13 Jun 2012 14:35:30 +0000 (UTC) To: 11686@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jun 13 16:35:29 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SeofR-0003c2-B2 for geb-bug-gnu-emacs@m.gmane.org; Wed, 13 Jun 2012 16:35:29 +0200 Original-Received: from localhost ([::1]:37571 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SeofR-0004a5-88 for geb-bug-gnu-emacs@m.gmane.org; Wed, 13 Jun 2012 10:35:29 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:35185) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SeofK-0004Zz-14 for bug-gnu-emacs@gnu.org; Wed, 13 Jun 2012 10:35:27 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SeofC-0001WY-1l for bug-gnu-emacs@gnu.org; Wed, 13 Jun 2012 10:35:21 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:59675) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SeofB-0001WU-VE for bug-gnu-emacs@gnu.org; Wed, 13 Jun 2012 10:35:13 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1Seoht-0000tu-H3 for bug-gnu-emacs@gnu.org; Wed, 13 Jun 2012 10:38:01 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: <87ipewb637.fsf@gnu.org> Resent-From: Lawrence Mitchell Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 13 Jun 2012 14:38:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 11686 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.13395982563430 (code B ref -1); Wed, 13 Jun 2012 14:38:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 13 Jun 2012 14:37:36 +0000 Original-Received: from localhost ([127.0.0.1]:40988 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SeohU-0000tH-C6 for submit@debbugs.gnu.org; Wed, 13 Jun 2012 10:37:36 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:52964) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SeohS-0000t8-Ig for submit@debbugs.gnu.org; Wed, 13 Jun 2012 10:37:35 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Seoef-0001GI-VC for submit@debbugs.gnu.org; Wed, 13 Jun 2012 10:34:46 -0400 Original-Received: from lists.gnu.org ([208.118.235.17]:46440) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Seoef-0001G9-Ra for submit@debbugs.gnu.org; Wed, 13 Jun 2012 10:34:41 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:48643) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SeoeZ-00046D-GA for bug-gnu-emacs@gnu.org; Wed, 13 Jun 2012 10:34:41 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SeoeQ-0001Dz-S9 for bug-gnu-emacs@gnu.org; Wed, 13 Jun 2012 10:34:34 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:37893) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SeoeQ-0001Dh-Kg for bug-gnu-emacs@gnu.org; Wed, 13 Jun 2012 10:34:26 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1SeoeM-0000Uh-4D for bug-gnu-emacs@gnu.org; Wed, 13 Jun 2012 16:34:22 +0200 Original-Received: from e4300lm.epcc.ed.ac.uk ([129.215.63.156]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 13 Jun 2012 16:34:21 +0200 Original-Received: from wence by e4300lm.epcc.ed.ac.uk with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 13 Jun 2012 16:34:21 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 41 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: e4300lm.epcc.ed.ac.uk User-Agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.1.50 (gnu/linux) Cancel-Lock: sha1:vt8mPF9w4TJgjPHslw0dfugBmbg= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:60937 Archived-At: Stefan Monnier wrote: >> Here's a patch, think this is right: >> Return NAME, not definition from defun and defmacro >> * lisp/emacs-lisp/byte-run.el (defun, defmacro): Return newly created >> definition's name, not its definition. > I wonder what is the impact on the generated byte-code. If the name is thrown away, there's no impact afaict. If you assign the name to something there's a small increase. Here's an example before and after for (defvar foo (defun foo (&rest x) x)) Before: (defvar foo (defalias 'foo #[(&rest x) "^H\207" [x] 1])) After: (defvar foo (byte-code "\300\301\300\302\"\210\207" [foo defalias #[(&rest x) "^H\207" [x] 1]] 4)) > Maybe a simpler way is to change defalias to return the name rather than > the value. But defalias says: | (defalias SYMBOL DEFINITION &optional DOCSTRING) | Set SYMBOL's function definition to DEFINITION, and return DEFINITION. So you'll probably then get a bug report about that instead. Cheers, Lawrence -- Lawrence Mitchell