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: 14 May 2004 14:27:23 -0400
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

> This is a patch that adds `curried functions' as discussed, using the
> #[...] syntax.

>    (curry 'concat "The ")
>    => #[curry concat "The "]

>    (mapcar (curry 'concat "The ") '("a" "b" "c"))
>    => ("The a" "The b" "The c")

> Does this look useful for your purposes Lars?

Just some nitpicking: `curry' is the action of taking a function of
2 arguments and turning it into a function of one arg that returns another
function that expects the second arg.  I.e. (in pseudo Lisp):

     (curry 'concat)
     => (lambda (x) (lambda (y) (concat x y)))

     (funcall (curry 'concat) "The ")
     => (lambda (y) (concat "The " y))

     (mapcar (funcall (curry 'concat) "The ") '("a" "b" "c"))
     => ("The a" "The b" "The c")

I do not mean to say that you should change your `curry' to behave
differently, but just that the name `curry' is not quite correct for your
use (although your operation is definitely related to currying).

What your `curry' does is a combination of curry and function application,
which results in a partial function application.  Maybe we should call it
`partial-funcall'?


        Stefan "not good with names"




reply via email to

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