From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Brand Subject: Re: evaluation context in call statements Date: Wed, 26 Jun 2013 18:53:43 +0200 Message-ID: References: <444ea6cff489e2adc97092bdac881aef@mail.rickster.com> <878v1y574d.fsf@Rainer.invalid> <874ncm55ma.fsf@Rainer.invalid> <87r4fq3ptf.fsf@Rainer.invalid> <87ip11h2zq.fsf@gmail.com> <87ehboewrr.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:40384) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ursyc-0007LX-6d for emacs-orgmode@gnu.org; Wed, 26 Jun 2013 12:53:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UrsyW-0006vR-St for emacs-orgmode@gnu.org; Wed, 26 Jun 2013 12:53:50 -0400 Received: from mail-la0-x22e.google.com ([2a00:1450:4010:c03::22e]:32939) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UrsyW-0006vI-GT for emacs-orgmode@gnu.org; Wed, 26 Jun 2013 12:53:44 -0400 Received: by mail-la0-f46.google.com with SMTP id eg20so14066888lab.19 for ; Wed, 26 Jun 2013 09:53:43 -0700 (PDT) In-Reply-To: <87ehboewrr.fsf@gmail.com> 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: Eric Schulte Cc: Org Mode Hi Eric On Wed, Jun 26, 2013 at 4:54 PM, Eric Schulte wrote: >> http://thread.gmane.org/gmane.emacs.orgmode/72513/focus=73547 > > They will overwrite eachother's results. I do not understand. In order to avoid that they will overwrite eachother's results I added `dummy_name="osx"' and `dummy_name="gnu"' to the call arguments. What did you mean? > We are currently discussing > alternatives which would change this behavior. My suggestions to this discussion have been two alternatives that already work now and that I already used, see my use case "unicode_normal_form_c" and my patch with the ERT in the other thread mentioned above: 1) use :session where supported like for emacs-lisp source blocks 2) use ":var dummy_name" as a workaround where :session is not supported like for shell source blocks >> ------------------------------------------------------------------- >> #+NAME: i_am_curious_how_this_works >> #+BEGIN_SRC emacs-lisp >> (format "%s" org-babel-current-src-block-location) >> #+END_SRC >> >> #+CALL: i_am_curious_how_this_works() >> >> #+RESULTS: i_am_curious_how_this_works() >> : # >> #+CALL: i_am_curious_how_this_works() >> >> (Here I expect to see the result "#".) >> ------------------------------------------------------------------- > > This works as expected. Depending on the call line executed, I get > different points in the second results. I am sorry, I wanted to say that I want to do something like (note: not current behavior) ------------------------------------------------------------------- #+NAME: i_am_curious_how_this_works #+BEGIN_SRC emacs-lisp (format "%s" org-babel-current-src-block-location) #+END_SRC #+CALL: i_am_curious_how_this_works() #+RESULTS: i_am_curious_how_this_works() : # #+CALL: i_am_curious_how_this_works() #+RESULTS: i_am_curious_how_this_works() : # ------------------------------------------------------------------- and would like the yet to be defined solution in discussion here to make also this possible, together with the appropriate change if necessary to the example given above. Currently working alternative with the change to use ":session": ------------------------------------------------------------------- #+NAME: i_am_curious_how_this_works #+BEGIN_SRC emacs-lisp (format "%s" org-babel-current-src-block-location) #+END_SRC #+CALL: i_am_curious_how_this_works[:session upper]() #+RESULTS: i_am_curious_how_this_works[:session upper]() : # #+CALL: i_am_curious_how_this_works[:session lower]() #+RESULTS: i_am_curious_how_this_works[:session lower]() : # ------------------------------------------------------------------- Currently working alternative with the change to use ":var dummy_name": ------------------------------------------------------------------- #+NAME: i_am_curious_how_this_works #+BEGIN_SRC emacs-lisp :var dummy_name="" (format "%s" org-babel-current-src-block-location) #+END_SRC #+CALL: i_am_curious_how_this_works(dummy_name="upper") #+RESULTS: i_am_curious_how_this_works(dummy_name="upper") : # #+CALL: i_am_curious_how_this_works(dummy_name="lower") #+RESULTS: i_am_curious_how_this_works(dummy_name="lower") : # ------------------------------------------------------------------- > Currently if you want have separate results for call lines with the same > variables you will need to use a dummy variable. Ok, this answers one of my questions in the other thread and confirms my expectation. Does it mean that my patch with the ERT as of 2013-06-19 from the other thread is ok for now and can be applied just to reflect what is currently supported? Or should I change something else in the patch? Michael