Questions tagged «org-babel»

组织模式的功能,可处理多种语言的源代码。它可以从Org模式文档中执行源代码,从而便于生成有文化的编程文档和管理可重复的研究。请注意,[tag:org-babel]现在已作为“与源代码一起使用”并入[tag:orgmode]中,而不再是单独的扩展名。

3
使用org-babel,如何命名函数调用的结果并重用它们
在中org-mode,我试图定义一个函数,一个变量,然后将对第一个变量的函数调用结果分配给另一个变量。但是,看来我不能在后续的函数调用中使用此新变量。 内联函数调用确实可以,但是首先影响变量的值可以加快调试速度,以防万一在第一个函数调用中出现问题,并避免重复可能昂贵的计算。 MWE :((require 'ob-emacs-lisp)根据需要使用) #+name: square #+begin_src emacs-lisp :var x=3 (message (format "%s" (* x x))) #+end_src #+RESULTS: square : 9 #+name: value : 45 #+name: squaredvalue #+call: square(x=value) #+RESULTS: squaredvalue : 2025 Now I try to reuse this value: #+begin_src emacs-lisp :var res=squaredvalue (message res) #+end_src #+RESULTS: : …
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.