[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: What's up with apply-partially?
From: |
Artur Malabarba |
Subject: |
Re: What's up with apply-partially? |
Date: |
Sat, 24 Jan 2015 01:53:36 -0200 |
> So why not just
>
> (defun apply-partially (fun &rest args)
> (lambda (&rest args2) (apply fun (append args args2))))
>
> Where is the point in the complicated redefinition that returns a
> basically uncompiled function? Why not just take Eli's definition and
> simplify it in line with lexical-binding now being set?
As Leo mentioned, the current definition creates the argument list
when `apply-partially' is first called, whereas your suggestion has to
call `append' everytime the returned function is called.
I think that's the only reason. It's unclear to me how that
performance difference compares with the disadvantage of the returned
function not being compiled.
- What's up with apply-partially?, David Kastrup, 2015/01/23
- Re: What's up with apply-partially?, Leo Liu, 2015/01/23
- Re: What's up with apply-partially?, Stefan Monnier, 2015/01/24
- Re: What's up with apply-partially?, David Kastrup, 2015/01/24
- Re: What's up with apply-partially?, Stefan Monnier, 2015/01/25
- [PATCH] Let apply-partially make use of lexical binding in subr.el, David Kastrup, 2015/01/25
- Re: [PATCH] Let apply-partially make use of lexical binding in subr.el, David Kastrup, 2015/01/27
- Re: [PATCH] Let apply-partially make use of lexical binding in subr.el, Stefan Monnier, 2015/01/29
- Re: [PATCH] Let apply-partially make use of lexical binding in subr.el, David Kastrup, 2015/01/29
Re: What's up with apply-partially?,
Artur Malabarba <=