From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Stephen J. Turnbull" Newsgroups: gmane.emacs.devel Subject: Re: lexbind Date: Sat, 15 Mar 2008 07:10:09 +0900 Message-ID: <87tzj9rm7y.fsf@uwakimon.sk.tsukuba.ac.jp> References: <87ir02fqlw.fsf@catnip.gol.com> <87ir02w0op.fsf@uwakimon.sk.tsukuba.ac.jp> <878x0xww47.fsf@uwakimon.sk.tsukuba.ac.jp> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1205532145 19830 80.91.229.12 (14 Mar 2008 22:02:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 14 Mar 2008 22:02:25 +0000 (UTC) Cc: Miles Bader , Stefan Monnier , emacs-devel@gnu.org To: "paul r" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Mar 14 23:02:51 2008 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 1JaHzD-0004OC-CB for ged-emacs-devel@m.gmane.org; Fri, 14 Mar 2008 23:02:47 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JaHye-00038D-7r for ged-emacs-devel@m.gmane.org; Fri, 14 Mar 2008 18:02:12 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JaHyQ-00032j-Ec for emacs-devel@gnu.org; Fri, 14 Mar 2008 18:01:58 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JaHyO-00031r-Kb for emacs-devel@gnu.org; Fri, 14 Mar 2008 18:01:57 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JaHyO-00031l-AO for emacs-devel@gnu.org; Fri, 14 Mar 2008 18:01:56 -0400 Original-Received: from mtps01.sk.tsukuba.ac.jp ([130.158.97.223]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JaHyI-0006V3-7c; Fri, 14 Mar 2008 18:01:50 -0400 Original-Received: from uwakimon.sk.tsukuba.ac.jp (uwakimon.sk.tsukuba.ac.jp [130.158.99.156]) by mtps01.sk.tsukuba.ac.jp (Postfix) with ESMTP id CACF01535A8; Sat, 15 Mar 2008 07:01:46 +0900 (JST) Original-Received: by uwakimon.sk.tsukuba.ac.jp (Postfix, from userid 1000) id C30B11A29EF; Sat, 15 Mar 2008 07:10:09 +0900 (JST) In-Reply-To: X-Mailer: VM 7.19 under 21.5 (beta28) "fuki" 2785829fe37c XEmacs Lucid X-detected-kernel: by monty-python.gnu.org: 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:92625 Archived-At: paul r writes: > At the end, what is the "officially recommended" way of defining a > local function ? > - (labels ...) , a macro coming from cl-macs ? > or - (let ((fct (lambda ...))) .) which is not a macro, but is > syntaxly less convenient to manipulate? > Thanks for your light. It depends on where you are working. If you're doing something deep in the core, then you do not want to require cl-macs (there are ways to avoid pulling it into the build, but they're fragile and ugly), and the (let ((fct ...)) ... (funcall fct ...)) idiom may be preferred. Otherwise, it's a matter of style, and since Stefan says both are OK, it's up to you. I've not tried the latter (I usually just use flet which is a bad habit from my early days, labels is usually more appropriate for my use), but the `(funcall fct ...)' idiom might be useful to remind the programmer later that `fct' is local, not global. Of course if the function is so big that you forget that while reading it, maybe something else is wrong with the code. :-)