Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: Naming a function (the symmetric of MAP)

5 views
Skip to first unread message

WJ

unread,
Sep 2, 2015, 4:41:51 PM9/2/15
to
Why this is marked as abuse? It has been marked as abuse.
Report not abuse
> this may be a stupid question, but I have a function that is the
> "symmetric" of MAP.
>
> (defun foo (result-type x funs)
> (map result-type (lambda (f) (funcall f x)) funs))

Gauche Scheme:

(define (foo x funs)
(map (cut <> x) funs))

gosh> (foo 8 (list sqrt exp))
(2.8284271247461903 2980.9579870417283)

--
In the United States in 2005, 37,460 white females were sexually assaulted or
raped by a black man, while between zero and ten black females were sexually
assaulted or raped by a white man.
http://archive.frontpagemag.com/readArticle.aspx?ARTID=26368
What I would most desire would be the separation of the white and black
races. --- A. Lincoln, July 17, 1858
0 new messages