From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Phil Sainty" Newsgroups: gmane.emacs.bugs Subject: bug#16067: 24.3; Documentation bug: Example code in (elisp) Anonymous Functions Date: Fri, 6 Dec 2013 19:18:53 +1300 (NZDT) Message-ID: <46834.202.78.240.7.1386310733.squirrel@mail.orcon.net.nz> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1386310818 27363 80.91.229.3 (6 Dec 2013 06:20:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 6 Dec 2013 06:20:18 +0000 (UTC) To: 16067@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Dec 06 07:20:23 2013 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 1Voolw-0001Cv-8G for geb-bug-gnu-emacs@m.gmane.org; Fri, 06 Dec 2013 07:20:20 +0100 Original-Received: from localhost ([::1]:57510 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Voolv-0001qR-OJ for geb-bug-gnu-emacs@m.gmane.org; Fri, 06 Dec 2013 01:20:19 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39566) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Voolm-0001qI-ED for bug-gnu-emacs@gnu.org; Fri, 06 Dec 2013 01:20:17 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Voolf-00023s-6t for bug-gnu-emacs@gnu.org; Fri, 06 Dec 2013 01:20:10 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:47050) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Voolf-00023G-30 for bug-gnu-emacs@gnu.org; Fri, 06 Dec 2013 01:20:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Voole-0006XD-G3 for bug-gnu-emacs@gnu.org; Fri, 06 Dec 2013 01:20:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: "Phil Sainty" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 06 Dec 2013 06:20:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 16067 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.138631076425053 (code B ref -1); Fri, 06 Dec 2013 06:20:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 6 Dec 2013 06:19:24 +0000 Original-Received: from localhost ([127.0.0.1]:32836 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Vool1-0006W0-E7 for submit@debbugs.gnu.org; Fri, 06 Dec 2013 01:19:24 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:37778) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Vooky-0006Vq-88 for submit@debbugs.gnu.org; Fri, 06 Dec 2013 01:19:21 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vookq-0001sW-QI for submit@debbugs.gnu.org; Fri, 06 Dec 2013 01:19:19 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:40293) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vookq-0001sS-N6 for submit@debbugs.gnu.org; Fri, 06 Dec 2013 01:19:12 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39476) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vookk-0001P6-6N for bug-gnu-emacs@gnu.org; Fri, 06 Dec 2013 01:19:12 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vookd-0001qE-Uo for bug-gnu-emacs@gnu.org; Fri, 06 Dec 2013 01:19:06 -0500 Original-Received: from nctlincom02.orcon.net.nz ([60.234.4.76]:55412) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vookd-0001pZ-Cr for bug-gnu-emacs@gnu.org; Fri, 06 Dec 2013 01:18:59 -0500 Original-Received: from mx5.orcon.net.nz (mx5.orcon.net.nz [219.88.242.55]) by nctlincom02.orcon.net.nz (8.14.3/8.14.3/Debian-9.4) with ESMTP id rB66NoGh019913 for ; Fri, 6 Dec 2013 19:23:51 +1300 Original-Received: from Debian-exim by mx5.orcon.net.nz with local (Exim 4.69) (envelope-from ) id 1VookX-00043F-5c for bug-gnu-emacs@gnu.org; Fri, 06 Dec 2013 19:18:53 +1300 Original-Received: from [172.16.100.200] (helo=mail.orcon.net.nz) by mx5.orcon.net.nz with esmtp (Exim 4.69) (envelope-from ) id 1VookX-000438-2k for bug-gnu-emacs@gnu.org; Fri, 06 Dec 2013 19:18:53 +1300 Original-Received: from 202.78.240.7 (SquirrelMail authenticated user 15631029) by mail.orcon.net.nz with HTTP; Fri, 6 Dec 2013 19:18:53 +1300 (NZDT) User-Agent: SquirrelMail/1.4.5 X-Priority: 3 (Normal) Importance: Normal X-DSPAM-Check: by mx5.orcon.net.nz on Fri, 06 Dec 2013 19:18:53 +1300 X-DSPAM-Result: Innocent X-DSPAM-Processed: Fri Dec 6 19:18:53 2013 X-DSPAM-Confidence: 0.5730 X-DSPAM-Probability: 0.0000 X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN, default) X-CanIt-Geo: No geolocation information available for 172.16.100.200 X-CanItPRO-Stream: base:default X-Canit-Stats-ID: 05KW6nPVL - 2ef5be4a77cb - 20131206 X-Scanned-By: CanIt (www . roaringpenguin . com) on 172.16.100.175 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x 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:81495 Archived-At: Re: Info node (elisp) Anonymous Functions The final piece of code is prefixed with "This would not happen if, say, you had constructed the anonymous function by quoting it as a list", but the code then fails to actually do that. It is actually identical to the initial version of the function: > In the following example, we define a `change-property' function > that takes a function as its third argument, followed by a > `double-property' function that makes use of `change-property' by > passing it an anonymous function: > > (defun change-property (symbol prop function) > (let ((value (get symbol prop))) > (put symbol prop (funcall function value)))) > > (defun double-property (symbol prop) > (change-property symbol prop (lambda (x) (* 2 x)))) > > Note that we do not quote the `lambda' form. > > If you compile the above code, the anonymous function is also > compiled. This would not happen if, say, you had constructed the > anonymous function by quoting it as a list: > > (defun double-property (symbol prop) > (change-property symbol prop (lambda (x) (* 2 x)))) > > In that case, the anonymous function is kept as a lambda expression in > the compiled code. The byte-compiler cannot assume this list is a > function, even though it looks like one, since it does not know that > `change-property' intends to use it as a function. In GNU Emacs 24.3.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.20.1) of 2013-12-06 on scmp-qa Windowing system distributor `The X.Org Foundation', version 11.0.11103000 System Description: Ubuntu 10.04.4 LTS Configured using: `configure '--prefix=/var/data/emacs/emacs24/emacs-24.3/usr/local' '--without-sound'' Important settings: value of $LANG: en_NZ.UTF-8 locale-coding-system: utf-8 default enable-multibyte-characters: t Major mode: Info Minor modes in effect: my-keys-minor-mode: t yas/global-mode: t savehist-mode: t global-smart-tab-mode: t show-paren-mode: t cua-mode: t minibuffer-depth-indicate-mode: t winner-mode: t global-subword-mode: t subword-mode: t global-hl-line-mode: t display-time-mode: t keep-buffers-mode: t auto-compile-on-load-mode: t auto-compile-on-save-mode: t tooltip-mode: t mouse-wheel-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t buffer-read-only: t line-number-mode: t transient-mark-mode: t Recent input: C-a C-h i g ( e l i s p ) SPC A n o n y m o u s SPC F u n c t i o n s C-s C-w C-w C-w C-w C-w C-w C-w C-w C-w C-w C-w C-w C-w C-w C-w C-w C-w C-w C-w C-w C-w C-w C-w C-w C-w C-w C-w C-w C-s C-s C-s C-s C-s C-s C-a C-SPC M-w M-x r e p o r t Recent messages: Loading /root/.emacs.d/.mc-lists.el (source)...done Waiting for `el-get' to complete... done post-merge git hook not installed. Init file loaded in 24.09s For information about GNU Emacs and the GNU system, type C-a. Package assoc is obsolete! Composing main Info directory...done Mark set Mark saved where search started byte-code: End of buffer [2 times] Load-path shadows: /root/.emacs.d/el-get/scratch/el-get hides /root/.emacs.d/el-get/el-get/el-get /root/.emacs.d/lisp/python hides /var/data/emacs/emacs24/emacs-24.3/usr/local/share/emacs/24.3/lisp/progmodes/python /root/.emacs.d/el-get/magit/.dir-locals hides /var/data/emacs/emacs24/emacs-24.3/usr/local/share/emacs/24.3/lisp/gnus/.dir-locals /root/.emacs.d/lisp/sym-comp hides /var/data/emacs/emacs24/emacs-24.3/usr/local/share/emacs/24.3/lisp/obsolete/sym-comp Features: (shadow sort mail-extr emacsbug message format-spec rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mail-utils misearch multi-isearch lexbind-mode disp-table whitespace eldoc rainbow-delimiters idle-highlight etags-select-autoloads idle-highlight-autoloads project-local-variables-autoloads wtf-autoloads yasnippet-bundle-autoloads yasnippet-bundle dropdown-list yasnippet assoc my-projects my-session savehist desktop my-theme hl-sexp zenburn-theme my-libraries sudo framemove windmove my-version-control my-images my-text my-programming my-python my-whitespace ws-trim my-indentation smart-tab my-rectangles my-utilities browse-kill-ring derived my-configuration dired-details dired-x uniquify highlight-parentheses paren delsel cua-base ffap url-parse auth-source eieio gnus-util mm-util mail-prsvr password-cache url-vars mb-depth winner ring subword hl-line time cus-edit cus-start cus-load wid-edit my-externals .loaddefs dtrt-indent multiple-cursors mc-separate-operations rectangular-region-mode mc-mark-pop mc-mark-more thingatpt mc-cycle-cursors mc-edit-lines multiple-cursors-core rect sauron windcycle iedit transpose-frame rainbow-mode mo-git-blame info notify dbus xml keep-buffers el-get cl-macs gv help-mode easymenu autoload cl dired my-elpa package my-local my-keybindings easy-mmode edmacro kmacro jka-compr byte-opt warnings auto-compile advice help-fns advice-preload packed cl-lib bytecomp byte-compile cconv time-date tooltip ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment lisp-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process dbusbind dynamic-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs)