From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: Re: Upcoming loss of usability of Emacs source files and Emacs. Date: Fri, 26 Jun 2015 09:57:58 -0400 Message-ID: References: <5581C29E.1030101@yandex.ru> <87r3p9fxm2.fsf@uwakimon.sk.tsukuba.ac.jp> <87k2v0fiji.fsf@uwakimon.sk.tsukuba.ac.jp> <20150619090225.GA2743@acm.fritz.box> <87fv5kfrfa.fsf@uwakimon.sk.tsukuba.ac.jp> <83twtzhi9g.fsf@gnu.org> <877fqvfvby.fsf@uwakimon.sk.tsukuba.ac.jp> <83fv5jh8ls.fsf@gnu.org> <874mlzf71d.fsf@uwakimon.sk.tsukuba.ac.jp> <558945C2.2010203@yandex.ru> <5589E2DB.1060207@yandex.ru> <558AD06F.6080200@yandex.ru> Reply-To: rms@gnu.org NNTP-Posting-Host: plane.gmane.org Content-Type: text/plain; charset=Utf-8 X-Trace: ger.gmane.org 1435327136 27769 80.91.229.3 (26 Jun 2015 13:58:56 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 26 Jun 2015 13:58:56 +0000 (UTC) Cc: eggert@cs.ucla.edu, emacs-devel@gnu.org, dgutov@yandex.ru, acm@muc.de, stephen@xemacs.org, eliz@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jun 26 15:58:52 2015 Return-path: Envelope-to: ged-emacs-devel@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 1Z8U9b-0001h9-7J for ged-emacs-devel@m.gmane.org; Fri, 26 Jun 2015 15:58:51 +0200 Original-Received: from localhost ([::1]:60208 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z8U9a-0001QA-CO for ged-emacs-devel@m.gmane.org; Fri, 26 Jun 2015 09:58:50 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38905) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z8U92-0000c7-BZ for emacs-devel@gnu.org; Fri, 26 Jun 2015 09:58:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z8U8x-0008Ig-SI for emacs-devel@gnu.org; Fri, 26 Jun 2015 09:58:16 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:57913) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z8U8l-0008A0-SN; Fri, 26 Jun 2015 09:58:00 -0400 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.82) (envelope-from ) id 1Z8U8k-0007fM-VU; Fri, 26 Jun 2015 09:57:59 -0400 In-reply-to: (message from Stefan Monnier on Thu, 25 Jun 2015 21:15:49 -0400) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:187565 Archived-At: [[[ To any NSA and FBI agents reading my email: please consider ]]] [[[ whether defending the US Constitution against all enemies, ]]] [[[ foreign or domestic, requires you to follow Snowden's example. ]]] I propose this doc string for macroexp-let2. What do you think? Evaluate BODY with SYM bound to an expression for EXP's value. The intended usage is that BODY generates an expression that will refer to EXP's value multiple times, but will evaluate EXP only once. As BODY generates that expression, it should use SYM to stand for the value of EXP. If EXP is a simple, safe expression, then SYM's value is EXP itself. Otherwise, SYM's value is a symbol which holds the value produced by evaluating EXP. The return value incorporates the value of BODY, plus additional code to evaluate EXP once and save the result so SYM can refer to it. If BODY consists of multiple forms, they are all evaluated but only the last one's value matters. TEST is a predicate to determine whether EXP qualifies as simple and safe; if TEST is nil, it defaults to `macroexp-const-p'. Example: (macroexp-let2 nil foo EXP `(* ,foo ,foo)) generates an expression that evaluates EXP once, then returns the square of that value. You could do this with (let ((foovar EXP)) (* foovar foovar)) but using `macroexp-let2' produces more efficient code in cases where EXP is a constant. -- Dr Richard Stallman President, Free Software Foundation (gnu.org, fsf.org) Internet Hall-of-Famer (internethalloffame.org) Skype: No way! See stallman.org/skype.html.