From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rainer M Krug Subject: Re: [babel][PATCHES] ob-R patches for review Date: Fri, 09 May 2014 14:02:58 +0200 Message-ID: References: <87ppjpm5n5.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:44729) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WijWN-0008K5-Pe for emacs-orgmode@gnu.org; Fri, 09 May 2014 08:03:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WijWI-0005Vh-AE for emacs-orgmode@gnu.org; Fri, 09 May 2014 08:03:23 -0400 Received: from mail-we0-f178.google.com ([74.125.82.178]:59079) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WijWH-0005VT-SD for emacs-orgmode@gnu.org; Fri, 09 May 2014 08:03:18 -0400 Received: by mail-we0-f178.google.com with SMTP id u56so3766657wes.23 for ; Fri, 09 May 2014 05:03:17 -0700 (PDT) In-Reply-To: (Rainer M. Krug's message of "Fri, 09 May 2014 11:11:32 +0200") 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: schulte.eric@gmail.com Cc: "emacs-orgmode@gnu.org" , Charles Berry --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Rainer M Krug writes: > Rainer M Krug writes: > >> Envoy=C3=A9 de mon iPhone >> >>> Le 8 mai 2014 =C3=A0 04:26, Charles Berry a =C3=A9cr= it : >>>=20 >>> Eric Schulte gmail.com> writes: >>>=20 >>>>=20 >>>> Rainer M Krug krugs.de> writes: >>>>=20 >>>>> Hi >>>>>=20 >>>>> Attached please find seven patches for review to implement the storing >>>>> of org variables in their own environment and to make the org-issued R >>>>> code look nicer in the R session. >>>>>=20 >>>>> Thanks, >>>>>=20 >>>>> Rainer >>>>=20 >>>> Hi Rainer, >>>>=20 >>>> Thanks for these patches. I don't have the R experience to review or >>>> maintain them, but I'm happy to apply them. >>>>=20 >>>> I missed some previous discussion in this thread. Are these patches >>>> ready to be applied as is? >>>=20 >>>=20 >>> IMO, the patches hard coded behaviors that would better be customizable >>> and optional.=20 >> >> I'll give feedback tomorrow and let you know about customization of >> the name of the environment. The general behavior of storing the >> variables in an environment should not be customizable as it is >> >> 1) safer then the behavior of storing each variable separately >> 2) no changes for the user are introduced=20 > > OK. Concerning customization options: > > There are a few points where customizations could be introduced: > > 1) transfer of variables from org to R, i.e. old behavior (variables in > .GlobalEnv) or new behavior (in own environment (.org_variables_)) or > own defined function > > 2) name of new environment > > 3) name of file into which to save the variables (org_variables.RData) > > Some comments to each: > > 1) As outlined above, I see neither changes in behavior for the user > nor disadvantages of the new behavior. As only one object is created in > R (.org_variables_) instead of one for each variable, the chances of > name clashes are much smaller. As the name of the variable starts with a > dot (.), ends with an underscore (_), it is very unlikely that there is > a nameclash in existing scripts (but you are right, one does not know). > So I don't think, that it is necessary to include an option for > disabling the old behavior.=20 > > Concerning defining an own function for data transfer, I am thinking of > putting the variable transfer into an R function which can then be > customized from R. My reasoning is that users using this feature are > more likely to be fluent in R then in lisp, so more able to change these > functions in R. In org, the whole R code would then simply replaced with > one function call. These functions would reside in a new environment (or > in the ESSR environment as offered by Vitalie). > > In addition, as it was not asked before to have this function > customizable, I don't think there would be a large need for it. > > 2) I don't think name clashes are likely, so I don't see a real need to > have the name of the org environment in R configurable. Especially when > using these variables in R, one can always use > .org_variables_::VARIABLENAME to access the original value. If the > environment name is customizable, this will be different between > customizations and not that easily reproducible between > org-installations. > > It would be easy to configure it, but I think it is rather a > disadvantage and would make the code (slightly) more complex. > > 3) The name into which the variables are saved could be configurable, > but again, I do not think this is such an issue. The saved environment > is anyway only of limited usage when the variables in org are not > defined file wide but per source block / tree. I am actually thinking of > removing this saving, although it is quite useful to make tangled code > usable on a non-org system when org variables are used - comments? > > So please let me know if you see the need of customization and for > which aspect. I started looking into ESS in more detail and I got some useful ideas.=20 I am including them at the moment in org, so please do not yet apply the patches. Cheers, Rainer > >> >> Cheers >> >> Rainer >> >>>=20 >>> Rainer and I had some back and forth about this -- see the thread. >>>=20 >>> Best, >>>=20 >>> Chuck >>>=20 >>>=20 >>>=20 =2D-=20 Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology,= UCT), Dipl. Phys. (Germany) Centre of Excellence for Invasion Biology Stellenbosch University South Africa Tel : +33 - (0)9 53 10 27 44 Cell: +33 - (0)6 85 62 59 98 Fax : +33 - (0)9 58 10 27 44 Fax (D): +49 - (0)3 21 21 25 22 44 email: Rainer@krugs.de Skype: RMkrug PGP: 0x0F52F982 --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.22 (Darwin) iQEcBAEBAgAGBQJTbMP3AAoJENvXNx4PUvmCwMkH/RbJ6sie8EYzxO5HMXL73Uyq /jn9qWxwplyVKO/zX3MU736eV5HmbY3s1SJwXHpmLrFKoTeU42yWgpBz8UvaZ6qw 5WRYDQzFQWWiMUQaR74aXN/lBnpoY/pJf2WQp+I4q1KAWa8B9dAPCFG7jgSYwxep +uVtX8bxqNqCn1WAcCPA+HcAbR7xz+hSIJa+FwJanJWKl3yJVNUemsCxTuSwT7U5 zBQxxK2a3d90UVDtEolkGY3qPgGnx/qphSo2tmGcVQ1Vfh9qOUyMB1ycgrDWv3m4 H4iql4e4l1n/BUhIVhshUNvnXfeMFOICwy9CY97QzrIuEE5F+OBTBSznqRVCvf0= =BRs9 -----END PGP SIGNATURE----- --=-=-=--