emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Return


From: Stephen J. Turnbull
Subject: Re: Return
Date: Fri, 10 Dec 2010 17:28:23 +0900

Stefan Monnier writes:
 > >> > There are lots of reasons for doing a defun inside of a function.
 > >> Give me examples and I'll tell you if I consider them as
 > >> valuable enough.
 > > Anything you would use `require' for inside a function.  Betcha find a
 > > dozen or more instances of require-in-a-function in Gnus alone.
 > 
 > Irrelevant: the defuns in the loaded file are defined at the top-level
 > 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.

My point is that you could just as well do the defuns inside the
function as in a require'd file.  Much 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?  If I want a local function
(which I do quite frequently) I use flet.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]