From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: Queestion concerning lists - was: [babel][PATCHES] ob-R patches for review Date: Mon, 12 May 2014 09:23:59 -0600 Message-ID: <87siofuifm.fsf@gmail.com> References: <87ppjpm5n5.fsf@gmail.com> <8F4A9158-D8BD-4FE7-8D9A-A22C4871BDB6@gmail.com> <87ppjnt88e.fsf@bzg.ath.cx> <874n0zhvgi.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:60733) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wjs89-0001bF-LP for emacs-orgmode@gnu.org; Mon, 12 May 2014 11:27:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wjs83-0004DL-Nl for emacs-orgmode@gnu.org; Mon, 12 May 2014 11:27:05 -0400 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Rainer M Krug Cc: Bastien , "emacs-orgmode@gnu.org" , "Charles C. Berry" > > I am working on it, but I have a question concerning strings and lists > in elisp. > > In the function org-babel-execute:R it says: > > ,---- > | (inside > | (list (org-babel-expand-body:R body params graphics-file))) > `---- > > I now want to convert "inside" to a comma separated string. I am doing > now the following: > > ,---- > | (replace-regexp-in-string "\n" ", " (format "%s" inside)) > `---- > > but this does not look elegant to me, as I am converting inside to a > string and then do a replace. There is the function mapconcat, but I > don't get it to work: > > ,---- > | (replace-regexp-in-string "\n" ", " (format "%s" inside)) > | "( createOrgVariablesEnvironment(), plot(1))" > | > | (mapconcat 'identity inside ", ") > | " createOrgVariablesEnvironment() > | plot(1)" > `---- > > What am I missing? > The following should work. (mapconcat #'identity inside ", ") If that doesn't give the expected result, maybe share an example value of inside, with the expected results. Best, Eric > > Thanks, > > Rainer > >> >> As it needs to be sourced for each R process once, the right place would >> be in org-babel-R-initiate-session - correct? >> >> What would be the best place to put these R files? >> >>> One lesson I've certainly learned from the Org-mode mailing list is >>> that you can't anticipate all of the ways that your code will be used, >>> so up-front customizability generally pays off. >> >> OK - point taken - and I am definitely one of those users who thinks >> about unusual usages of certain features. >> >> Cheers, >> >> Rainer >> >>> >>> Thanks, >>> Eric >>> >>>> >>>> Thanks >>>> >>>> Rainer -- Eric Schulte https://cs.unm.edu/~eschulte PGP: 0x614CA05D