From: Vladimir V. Zolotych
Subject: Re: How to do (map (type-of x) ...) right
Date: 
Message-ID: <3AD6BACC.297FF4DA@eurocom.od.ua>
Clemens Heitzinger wrote:
> 
> I want to write a function that takes a sequence, maps a function over
> it, and returns a sequence of the same type.
> 
> Let's see:
> 
> USER(178): (defun foo (x)
>                (map (type-of x) #'log x))
Why not MAPCAR instead of MAP ?

-- 
Vladimir Zolotych                         ······@eurocom.od.ua
From: Arthur Lemmens
Subject: Re: How to do (map (type-of x) ...) right
Date: 
Message-ID: <3AD6D967.D4EBF4FD@xs4all.nl>
"Vladimir V. Zolotych" wrote:
 
> Clemens Heitzinger wrote:
> >
> > I want to write a function that takes a sequence, maps a function over
> > it, and returns a sequence of the same type.
> >
> > Let's see:
> >
> > USER(178): (defun foo (x)
> >                (map (type-of x) #'log x))
> Why not MAPCAR instead of MAP ?

MAPCAR works only for lists, MAP works for other sequences too.

Arthur Lemmens