From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Fren Zeee Newsgroups: gmane.emacs.devel Subject: Re: Return Date: Wed, 22 Dec 2010 21:39:30 -0800 Message-ID: References: <87mxojwu15.fsf@uwakimon.sk.tsukuba.ac.jp> <87k4jnweng.fsf@uwakimon.sk.tsukuba.ac.jp> <87sjya2b7d.fsf@lola.goethe.zz> <87aaketne9.fsf@uwakimon.sk.tsukuba.ac.jp> <87y67yrpzs.fsf@uwakimon.sk.tsukuba.ac.jp> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1293082791 27708 80.91.229.12 (23 Dec 2010 05:39:51 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 23 Dec 2010 05:39:51 +0000 (UTC) Cc: David Kastrup , Stefan Monnier , emacs-devel@gnu.org To: "Stephen J. Turnbull" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Dec 23 06:39:47 2010 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.69) (envelope-from ) id 1PVdty-0008Tn-He for ged-emacs-devel@m.gmane.org; Thu, 23 Dec 2010 06:39:46 +0100 Original-Received: from localhost ([127.0.0.1]:54733 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PVdtx-0002zg-EO for ged-emacs-devel@m.gmane.org; Thu, 23 Dec 2010 00:39:45 -0500 Original-Received: from [140.186.70.92] (port=46813 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PVdtl-0002zX-PE for emacs-devel@gnu.org; Thu, 23 Dec 2010 00:39:34 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PVdtk-0007oN-8o for emacs-devel@gnu.org; Thu, 23 Dec 2010 00:39:33 -0500 Original-Received: from mail-iw0-f169.google.com ([209.85.214.169]:48400) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PVdtk-0007nn-0p; Thu, 23 Dec 2010 00:39:32 -0500 Original-Received: by iwn40 with SMTP id 40so6503624iwn.0 for ; Wed, 22 Dec 2010 21:39:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=0ij1BweZdN+cNRT6LVq8o7jE6WMvgC/gkWZJL0q+4GI=; b=OUY5dn8itPX1PyQaaValwnRReq1FRq6j3UwLdMC2fhxzQYh0nOsQlogZKZWtaOZLO8 LBhHO/Zy28gdYcRL0ceKHk3X/0zAgHp8y8GAphW9CJXdeA8TR9/ykmfEB7KFQ3ngmwBf ybKHKJHzprmAXsUmaKdpEGZ9dZhgbpROKxLXk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=NRw2cWdhSn24HAZPNTbN8tvKGqSfVjoZ5843DeQjpsyDJn+6AupPl9epyGbEFoVpPE m3mXaKeJL/dVDa2ELiGbrsstaItWCRHSbOBnpGNPWsuSm3UvEFOugsLCmGL8eADKOpNH DLdSlEzflScc6BK2iJu1R6lAWvuBVtWty2pGk= Original-Received: by 10.231.59.77 with SMTP id k13mr7477262ibh.188.1293082770686; Wed, 22 Dec 2010 21:39:30 -0800 (PST) Original-Received: by 10.231.11.137 with HTTP; Wed, 22 Dec 2010 21:39:30 -0800 (PST) In-Reply-To: <87y67yrpzs.fsf@uwakimon.sk.tsukuba.ac.jp> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) 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:133918 Archived-At: On Fri, Dec 10, 2010 at 12:28 AM, Stephen J. Turnbull wrote: > Stefan Monnier writes: > =A0> >> > There are lots of reasons for doing a defun inside of a functio= n. > =A0> >> Give me examples and I'll tell you if I consider them as > =A0> >> valuable enough. > =A0> > Anything you would use `require' for inside a function. =A0Betcha = find a > =A0> > dozen or more instances of require-in-a-function in Gnus alone. > =A0> > =A0> Irrelevant: the defuns in the loaded file are defined at the top-lev= el > =A0> even if the require is called from within a function. > > Irrelevant: the defuns in the function are defined at the top-level > even though defun is called from within a function. In this case it is helpful to allow nested defuns. Most code is developed in build-fix method as Paul Graham has explained very well. For making modules, one puts simply a wrapper and want the minimal to edit and move things around. An auxilary function then gets nested. I do this often in a language that is lisp under a different label. > My point is that you could just as well do the defuns inside the > function as in a require'd file. =A0Much of the time it makes sense to > split them out into a file, of course, but I don't see any good reason > why that should be enforced if the author would prefer to put her > defuns in a function. > > defun is always at top level, right? =A0If I want a local function > (which I do quite frequently) I use flet. > > >