help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: 'let' for functions ?


From: Hannu Koivisto
Subject: Re: 'let' for functions ?
Date: Thu, 31 Oct 2002 16:18:13 +0200
User-agent: Gnus/5.090007 (Oort Gnus v0.07) Emacs/21.2 (i686-pc-linux-gnu)

chris@example.org writes:

> I just wondered if it is possible to get the lexical scoping effect for
> functions that 'let' and related functions provide for variables.

Note that Emacs Lisp is dynamically scoped, thus let does not
provide lexical scoping but dynamic scoping.

> i.e I want to be able to do something like this :
>
> (let ((funca funcb))
>    (require 'foolib))

You can use flet (or labels if you need recursion) from the cl
package:

(require 'cl)

(flet ((funca (&rest args)
         (apply 'funcb args)))
  (require 'foolib))

-- 
Hannu


reply via email to

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