Subject: bug#17623: 24.4.50; incorrect example for `apply-partially' in (elisp) `Calling Functions'

From: Stefan Monnier <[email-masked]>
Date: Sun, 29 Jun 2014 17:46:28 -0400

> There's nothing wrong per see in the current text, but it sounds as if
> `apply-partially` would somehow analyze the argument list of its first
> argument.  But it's semantic is very simple.

> Say that

>   (apply-partially f arg_1 ... arg_n) 

> is equivalent to

>   (lambda (&rest args) (apply f arg_1 ... arg_n args))

This equivalence is not true either.  E.g.

    (prog1 (apply-partially #'message format)
      (setq format "hello"))

BTW, `apply-partially' is mostly a crutch to have "simple closures" in
a dynamically scoped setting.  In code that uses lexical-binding, it's
generally better to use a straight closure.

        Stefan