From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dan Davison Newsgroups: gmane.emacs.help Subject: Re: problem with mapconcat Date: Wed, 03 Mar 2010 13:50:34 +0000 Message-ID: <87y6i94iqd.fsf@stats.ox.ac.uk> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1267683219 24723 80.91.229.12 (4 Mar 2010 06:13:39 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 4 Mar 2010 06:13:39 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Christian Wittern Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Mar 04 07:13:35 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 1Nn4JR-0005e1-H6 for geh-help-gnu-emacs@m.gmane.org; Thu, 04 Mar 2010 07:13:33 +0100 Original-Received: from localhost ([127.0.0.1]:48512 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nn4JQ-0003Kf-P1 for geh-help-gnu-emacs@m.gmane.org; Thu, 04 Mar 2010 01:13:32 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NmoyJ-0002tW-8S for help-gnu-emacs@gnu.org; Wed, 03 Mar 2010 08:50:43 -0500 Original-Received: from [140.186.70.92] (port=51155 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NmoyH-0002tL-Ec for help-gnu-emacs@gnu.org; Wed, 03 Mar 2010 08:50:41 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NmoyG-0006wp-EZ for help-gnu-emacs@gnu.org; Wed, 03 Mar 2010 08:50:41 -0500 Original-Received: from markov.stats.ox.ac.uk ([163.1.210.1]:64139) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NmoyG-0006wH-6Y for help-gnu-emacs@gnu.org; Wed, 03 Mar 2010 08:50:40 -0500 Original-Received: from blackcap.stats.ox.ac.uk (blackcap.stats [163.1.210.5]) by markov.stats.ox.ac.uk (8.13.6/8.13.6) with ESMTP id o23DoZEd025984; Wed, 3 Mar 2010 13:50:35 GMT Original-Received: by blackcap.stats.ox.ac.uk (Postfix, from userid 5158) id F35DC3201D; Wed, 3 Mar 2010 13:50:34 +0000 (GMT) In-Reply-To: (Christian Wittern's message of "Wed, 3 Mar 2010 12:49:17 +0000 (UTC)") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Solaris 8 (1) X-Mailman-Approved-At: Thu, 04 Mar 2010 01:07:29 -0500 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:72348 Archived-At: Christian Wittern writes: > Hi there, > > I am trying to build a regex with lisp, which inserts a certain string > into another string between each character, for example "abc" should > turn into "a/b/c". > > With mapconcat, I think this should work: > > (mapconcat 'identity (string-to-list "abc") "/") > > since the description for mapconcat says > > (mapconcat FUNCTION SEQUENCE SEPARATOR) > > However, when I try to evaluate this in Emacs 23.1, here it throws the > following error: > > Debugger entered--Lisp error: (wrong-type-argument sequencep 97) > mapconcat(identity (97 98 99) "/") > eval((mapconcat (quote identity) (string-to-list "abc") "/")) > > I wonder what I am doing wrong or if there is another way to achieve > what I am trying to do. These do it (mapconcat 'char-to-string (string-to-list "abc") "/") (mapconcat 'identity (split-string "abc" "" t) "/") Dan > > Any help appreciated, > > Christian