From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jack Li Subject: Can a code block be evaluated in multiple sessions Date: Thu, 5 Jan 2017 15:48:33 +0800 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=089e01494a7c98323605455422ca Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:43058) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cP2nM-0001tJ-Kc for emacs-orgmode@gnu.org; Thu, 05 Jan 2017 02:49:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cP2nM-0004Jc-09 for emacs-orgmode@gnu.org; Thu, 05 Jan 2017 02:49:08 -0500 Received: from mail-wj0-x229.google.com ([2a00:1450:400c:c01::229]:34855) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cP2nL-0004Is-P1 for emacs-orgmode@gnu.org; Thu, 05 Jan 2017 02:49:07 -0500 Received: by mail-wj0-x229.google.com with SMTP id i20so28208645wjn.2 for ; Wed, 04 Jan 2017 23:49:05 -0800 (PST) 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" To: emacs-orgmode@gnu.org --089e01494a7c98323605455422ca Content-Type: text/plain; charset=UTF-8 Hi, Can anyone tell me if a code block can be evaluated in multiple sessions? In this toy example I provide, function "f1" is defined in the first block, and I want to use "f1" in both the second block (session a) and the third block (session b). #+BEGIN_SRC R f1 <- function(x,y,z) x+y+z #+END_SRC #+BEGIN_SRC R :session a f1(1,2,3) #+END_SRC #+BEGIN_SRC R :session b f1(2,4,6) #+END_SRC PS: the three blocks should be in one .org file, and, when exporting, "session a" and "session b" will be run simultaneously and independently. Thanks, Jack --089e01494a7c98323605455422ca Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi,

Can anyone tell me if a = code block can be evaluated in multiple sessions? In this toy example I pro= vide, function "f1" is defined in the first block, =C2=A0and I wa= nt to use "f1" in both the second block (session a) =C2=A0and the= third block (session b).=C2=A0

#+BEGIN_SRC R=C2= =A0
=C2=A0 f1 <- function(x,y,z) x+y+z
#+END_SRC

#+BEGIN_SRC R :session a
f1(1,2,3)
#+END_SRC

#+BEGIN_SRC R =C2=A0:session b
f1(2,4,6)
#+END_SRC

PS: the three blo= cks should be in one .org file, and, when exporting, "session a" = and "session b" will be run simultaneously and independently.

Thanks,
Jack
--089e01494a7c98323605455422ca--