emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: User-reserved element in byte code vectors


From: Stefan Monnier
Subject: Re: User-reserved element in byte code vectors
Date: 16 May 2004 19:53:48 -0400
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

> I recommend leaving the first slot after `curry' unused.  That way it
> could be used later to control extensions, such as a feature to
> specify the order of curried and noncurried arguments.

We can already represent `curry' just fine with something like:

   (defun curry (f &rest args1)
     `(lambda (&rest args2)
        (apply ,f (nconc ',args1 args2))))

I.e. the only reason for the new construct proposed by Miles is to get
better performance, so it only makes sense in cases where it's
heavily used.  The case that Miles is thinking about is closures.
I don't know of any other case where such a construct would need good
performance while not fitting within the mold of Miles's `curry'.

Even just a "reverse curry" already sounds pointless: for the rare cases
where you might want it, you can always easily replace a call like

   (reverse-curry f foo)

into

   (curry (lambda (z y x) (f x y z)) foo)

which is only slightly slower.


        Stefan




reply via email to

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