chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] name this HOF?


From: Tobia Conforto
Subject: Re: [Chicken-users] name this HOF?
Date: Fri, 25 Jan 2008 13:05:53 +0100

Ivan Raikov wrote:
You could call it xmap (exchanged map)
whereas map applies a single function to each of multiple arguments, xmap applies each of multiple functions to a single argument.

You mean a single argument list.

In any case, his tup is more like a curried xmap.
I think a plain exchanged map should look like this:

(define (xmap funcs args)
  (map (lambda (func)
         (apply func args))
       funcs))

(xmap (list first third second) '((a b c d e)))
=> (a c b)

The second argument to this xmap is a doubled list because it's a list of arguments, containing a single argument which is itself a list.


Tobia




reply via email to

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