From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Charles C. Berry" Subject: Re: [PATCH] -for review- Tangling with variable transfer of variables Date: Mon, 23 Jun 2014 11:25:11 -0700 Message-ID: References: <87zjh8bo8s.fsf@gmail.com> Mime-Version: 1.0 Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:52555) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wz8vh-0005aI-T0 for emacs-orgmode@gnu.org; Mon, 23 Jun 2014 14:25:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wz8va-0007lr-Gr for emacs-orgmode@gnu.org; Mon, 23 Jun 2014 14:25:21 -0400 Received: from iport-acv2-out.ucsd.edu ([132.239.0.174]:33738) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wz8va-0007kw-8y for emacs-orgmode@gnu.org; Mon, 23 Jun 2014 14:25:14 -0400 In-Reply-To: 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: emacs-orgmode@gnu.org, Eric Schulte On Mon, 23 Jun 2014, Rainer M Krug wrote: > "Charles C. Berry" writes: > > V> On Fri, 20 Jun 2014, Rainer M Krug wrote: >> >>> Attached please find =the reworked patch. >>> >>> 1) uses local() and closes connection >>> 2) does not leave a variable cal;led file behind >>> >> [deleted] > > OK - attached please find two patches: > > 0001-lisp-ob-R.el-Fix-tangling-with-tables.patch > 0002-Make-transfer-of-values-from-R-type-aware.patch > > The first one fixes tangling with tables including discussed > suggestions, the second one moves the definition of the R code into > defconst and introduces type awareness for the transfer of *values*, but > not tables. I reworked your suggestion and now integer are transferred > to R as integers (L) and float as double. > This already worked for tables. > > Could you please check the second patch? In my checks everything worked > as expected. I think these are good to go. I checked several cases and all seemed to work as expected. Some comments on this and your recent posts in this thread: I see you took the suggestion to use (prin1-to-string value) on the 'left-over' objects. With that stuff like :var x=[1 2 3] will work. :-) The only failure I could trigger was with this block: #+BEGIN_SRC R :session :var x=(org-export-get-backend 'latex) x #+END_SRC which triggered 'Eval buffer', added a bunch of ^G's to my session log, and hung until I ran C-g (keyboard-quit). When run with :session none, it works. I suspected the long string tripped over a limitation or bug in iESS-mode or comint-mode, but this runs: #+BEGIN_SRC R :session :var x=(append (make-vector 10000 '(1 2)) '((1 2 3))) :results output summary(x) #+END_SRC so I am not sure what gives. Chuck