Hi Benda, 2015ko irailak 18an, Benda Xu-ek idatzi zuen:
[...] > However, this feature does not work with cache. In case that "input" > code block takes a long time to evaluate, it is a good idea to cache the > result. But that returns "nil" in subsequent function calls: > > #+name: input > #+BEGIN_SRC sh :results output :cache yes > echo "3" > #+END_SRC > > #+RESULTS[f69ecd305ebd448fc39b05809d214261a777c6bc]: input > : 3 > > #+BEGIN_SRC R :var a=input() > a > #+END_SRC > > #+RESULTS: > : nil > > Recalling the cached function should return exactly the same result by > definition of "cache". I can’t reproduce this on org master. > > Or is there a way to circumvent this by referring to the "RESULT" field > directly? I believe you can add a name to the results, and use that: ,---- | #+name: input | #+BEGIN_SRC sh :results output :cache yes | echo "3" | #+END_SRC | | #+name: input-results | #+RESULTS[f69ecd305ebd448fc39b05809d214261a777c6bc]: input | : 3 | | #+BEGIN_SRC R :var a=input-results | a | #+END_SRC | | #+RESULTS: | : 3 `---- Hope this helps, -- Aaron Ecay