There are bugs with calling named call lines and blocks when they are cached.

If the callee is cached, the results vary when the caller is re-evaluated.

The following file demonstrates the bug(s). Unfortunately I don't have time
right now to debug...

#+BEGIN_SRC org
  ,* Cached results bug
  ,** Tests
  ,*** Fails with error:
  mapconcat: Wrong type argument: listp, "string=\"foo bar\""
  ,#+call: bad-src(string="foo bar")

  ,*** Fails with =nil= second time evaluated
  ,#+call: word(data=cached(string="bar fly"))

  ,*** Returns different results on second call (quotes words)
  ,#+call: word(data=cached-unwrapped(string="bar fly"))

  ,*** Works
  ,#+call: word(data=src(string="bar fly"))

  ,#+call: word(data=uncached(string="bar fly"))
  ,** Intermediate calls
  ,#+name: cached
  ,#+call: src(string="foo bar") :cache yes :results wrap

  ,#+name: uncached
  ,#+call: src(string="foo bar") :results wrap

  ,#+name: cached-unwrapped
  ,#+call: src(string="foo bar") :cache yes

  ,** Blocks
  ,#+name: bad-src
  ,#+BEGIN_SRC emacs-lisp :var string="" :cache yes
    string
  ,#+END_SRC

  This block works when called
  ,#+name: src
  ,#+BEGIN_SRC emacs-lisp :var string=""
    string
  ,#+END_SRC

  ,#+name: word
  ,#+BEGIN_SRC emacs-lisp :var data=""
    (split-string data)
  #+END_SRC
#+END_SRC

Reply via email to