[Top][All Lists]
[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"
- Re: User-reserved element in byte code vectors, (continued)
- Re: User-reserved element in byte code vectors, Miles Bader, 2004/05/02
- Re: User-reserved element in byte code vectors, Lars Brinkhoff, 2004/05/02
- Re: User-reserved element in byte code vectors, Richard Stallman, 2004/05/03
- Re: User-reserved element in byte code vectors, Miles Bader, 2004/05/03
- Re: User-reserved element in byte code vectors, Lars Brinkhoff, 2004/05/05
- Re: User-reserved element in byte code vectors, Richard Stallman, 2004/05/05
- Re: User-reserved element in byte code vectors, Miles Bader, 2004/05/06
- Re: User-reserved element in byte code vectors, Miles Bader, 2004/05/06
- Re: User-reserved element in byte code vectors, Richard Stallman, 2004/05/06
- Re: User-reserved element in byte code vectors, Miles Bader, 2004/05/14
- Re: User-reserved element in byte code vectors,
Stefan Monnier <=
- Re: User-reserved element in byte code vectors, Lars Brinkhoff, 2004/05/14
- Re: User-reserved element in byte code vectors, Miles Bader, 2004/05/14
- Re: User-reserved element in byte code vectors, Stefan Monnier, 2004/05/14
- Re: User-reserved element in byte code vectors, Richard Stallman, 2004/05/15
- Re: User-reserved element in byte code vectors, Miles Bader, 2004/05/15
- Re: User-reserved element in byte code vectors, Richard Stallman, 2004/05/17
- Re: User-reserved element in byte code vectors, Lars Brinkhoff, 2004/05/17
- Re: User-reserved element in byte code vectors, Stefan Monnier, 2004/05/17
- Re: User-reserved element in byte code vectors, Miles Bader, 2004/05/17
- Re: User-reserved element in byte code vectors, David Kastrup, 2004/05/17