all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Antoine Levitt <antoine.levitt@gmail.com>
Cc: 12895@debbugs.gnu.org
Subject: bug#12895: 24.3.50; Replacement for flet
Date: Thu, 15 Nov 2012 13:35:34 -0500	[thread overview]
Message-ID: <jwv390awwnj.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <87lie27vvd.fsf@gmail.com> (Antoine Levitt's message of "Thu, 15 Nov 2012 16:01:58 +0100")

tags 12895 notabug
thanks

>   Temporarily bind to PLACEs. This is the analogue of `let', but with
>   generalized variables
> If it excludes overrides, I think it should say so explicitely.  Right
> now I'm led to think it's like let for functions, and I've been using
> let for overriding just fine.

letf and cl-letf do not exclude overrides: it only does overrides
(well, pretty much, except if PLACE is a variable, in which case it's
just like a let).

But, indeed, the docstring of cl-flet was wrong since it said "Make
temporary function definitions" whereas these are not temporarily but local.
I just fixed it now, thank you.

>> Such override should be done with an advice.
> Unless I'm missing something easier, using an advice would be cumbersome
> (define the advice, activate it, run the function, then deactivate the
> advice, protecting for errors). Would you consider un-obsoleting flet?
> It isn't deprecated by either cl-flet or cl-letf.

Overriding a function is bad.  It can mess things up and throw you
majorly off-course when debugging the problem.  So it's good if
it's cumbersome.

Check my recent patch to js.el to see how I replaced flet with advices.


        Stefan





  reply	other threads:[~2012-11-15 18:35 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-15 13:35 bug#12895: 24.3.50; Replacement for flet Antoine Levitt
2012-11-15 14:46 ` Stefan Monnier
2012-11-15 15:01   ` Antoine Levitt
2012-11-15 18:35     ` Stefan Monnier [this message]
2012-11-15 22:42       ` Antoine Levitt
2012-11-15 23:05         ` Glenn Morris
2012-11-15 23:24           ` Antoine Levitt
2012-11-15 23:44             ` Glenn Morris
2012-11-15 23:47               ` Antoine Levitt
2012-11-15 23:51                 ` Glenn Morris
2012-11-16 14:34         ` Stefan Monnier
2012-11-16 14:49           ` Antoine Levitt
2012-11-16 15:24             ` Stefan Monnier
2016-01-31 17:42             ` Michael Heerdegen
2016-02-09 20:36               ` Antoine Levitt
2012-11-16  7:04   ` Katsumi Yamaoka
2012-11-16 14:33     ` Stefan Monnier
2012-11-16  1:21 ` Michael Heerdegen
2016-01-31 14:19 ` bug#12895: Status: " Marcin Borkowski
2016-01-31 16:51   ` Eli Zaretskii
2016-01-31 17:10     ` Marcin Borkowski

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

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

  git send-email \
    --in-reply-to=jwv390awwnj.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=12895@debbugs.gnu.org \
    --cc=antoine.levitt@gmail.com \
    /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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.