[Top][All Lists]

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

Re: User-reserved element in byte code vectors

From: Miles Bader
Subject: Re: User-reserved element in byte code vectors
Date: 18 May 2004 10:29:39 +0900

David Kastrup <address@hidden> writes:
> Without lexical binding, currying a curried function would probably
> not work when using the lambda approach (haven't thought this through
> in detail, though).

It should, I'd think -- the method suggested for using lambda to do it
is to construct a lambda expression at runtime, e.g.,

   (defun curry (fun &rest args)
       `(lambda (&rest user-args) (apply #',fun ,@args user-args)))

So currying a curried function does work, if rather `consily':

   (curry (curry 'concat "a" "b") "x" "y")
   => (lambda (&rest user-args)
        (apply (function
                (lambda (&rest user-args)
                  (apply (function concat) "a" "b" user-args)))
               "x" "y" user-args))

   (mapcar (curry (curry 'concat "a" "b") "x" "y") '("p" "q"))
   => ("abxyp" "abxyq")

"Whatever you do will be insignificant, but it is very important that
 you do it."  Mahatma Gandhi

reply via email to

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