unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Hannu Koivisto <azure@iki.fi>
Subject: Re: 'let' for functions ?
Date: Thu, 31 Oct 2002 16:18:13 +0200	[thread overview]
Message-ID: <87vg3i4rq2.fsf@lynx.ionific.com> (raw)
In-Reply-To: 1036073066.48586.0@iris.uk.clara.net

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	other threads:[~2002-10-31 14:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1036073066.48586.0@iris.uk.clara.net>
2002-10-31 14:18 ` Hannu Koivisto [this message]
2003-04-26 19:19   ` 'let' for functions ? Ed L Cashin
2003-04-26 20:01     ` Oliver Scholz
2003-04-26 20:20       ` Ed L Cashin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87vg3i4rq2.fsf@lynx.ionific.com \
    --to=azure@iki.fi \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).