[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: problem with mapconcat
From: |
Stephen Berman |
Subject: |
Re: problem with mapconcat |
Date: |
Thu, 04 Mar 2010 10:35:29 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.1.93 (gnu/linux) |
On Thu, 04 Mar 2010 08:36:46 +0100 Andreas Röhler
<andreas.roehler@easy-emacs.de> wrote:
> Thamer Mahmoud wrote:
>> Thamer Mahmoud <thamer.mahmoud@gmail.com> writes:
>>> Another alternative:
>>>
>>> (mapconcat 'string (string-to-list "abc") "/")
>>>
>>> => "a/b/c"
>>
>> After sending the above, I realized that this would work too:
>>
>> (mapconcat 'string "abc" "/")
>>
>>
>>
>>
>>
>
> That seems to work either, whats strange for me:
>
> (mapconcat 'list "abc" "/")"a/b/c"
Maybe this helps clarify why that works:
(let (r)
(dolist (e (string-to-list "abc") r)
(setq r (concat r (if (null r) "" "/") (list e)))))
Steve Berman
Re: problem with mapconcat, Dan Davison, 2010/03/04
Re: problem with mapconcat, Kevin Rodgers, 2010/03/04