[Top][All Lists]

[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.

reply via email to

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