From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stephen Berman Newsgroups: gmane.emacs.help Subject: Re: problem with mapconcat Date: Thu, 04 Mar 2010 10:35:29 +0100 Message-ID: <87eik0o2e6.fsf@escher.home> References: <87bpf5zex5.fsf@mithlond.arda> <87635d5szl.fsf@zemblan.newkuwait.org> <871vg15s6r.fsf@zemblan.newkuwait.org> <4B8F630E.2040301@easy-emacs.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1267696558 32229 80.91.229.12 (4 Mar 2010 09:55:58 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 4 Mar 2010 09:55:58 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Mar 04 10:55:54 2010 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Nn7mc-0003t0-3B for geh-help-gnu-emacs@m.gmane.org; Thu, 04 Mar 2010 10:55:54 +0100 Original-Received: from localhost ([127.0.0.1]:44380 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nn7f4-0007sK-Le for geh-help-gnu-emacs@m.gmane.org; Thu, 04 Mar 2010 04:48:06 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Nn7WE-0003Kf-3G for help-gnu-emacs@gnu.org; Thu, 04 Mar 2010 04:38:58 -0500 Original-Received: from [140.186.70.92] (port=39711 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nn7WB-0002o2-0B for help-gnu-emacs@gnu.org; Thu, 04 Mar 2010 04:38:56 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Nn7TC-0007J4-JR for help-gnu-emacs@gnu.org; Thu, 04 Mar 2010 04:35:51 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]:36393) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Nn7TC-0007Ix-D0 for help-gnu-emacs@gnu.org; Thu, 04 Mar 2010 04:35:50 -0500 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1Nn7T8-0002Vw-0P for help-gnu-emacs@gnu.org; Thu, 04 Mar 2010 10:35:46 +0100 Original-Received: from i59f54a9a.versanet.de ([89.245.74.154]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 04 Mar 2010 10:35:45 +0100 Original-Received: from stephen.berman by i59f54a9a.versanet.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 04 Mar 2010 10:35:45 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 30 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: i59f54a9a.versanet.de User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.93 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:72357 Archived-At: On Thu, 04 Mar 2010 08:36:46 +0100 Andreas Röhler wrote: > Thamer Mahmoud wrote: >> Thamer Mahmoud 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