Re: Calling/using named babel code blocks

2019-12-18 Thread John Kitchin
I think you want: #+name: my-random-gen #+header: :var n=0 :var lim=0 #+BEGIN_SRC emacs-lisp (loop repeat n collect (random* lim)) #+END_SRC and this various versions of this #+BEGIN_SRC emacs-lisp :var results=my-random-gen(n=5, lim=1.0) results #+END_SRC #+RESULTS: | 0.27765703201293945 | 0.

Re: Calling/using named babel code blocks

2019-12-18 Thread Berry, Charles
> On Dec 18, 2019, at 9:10 AM, Lawrence Bottorff wrote: > > I thought I understood "metaprogramming," i.e., creating generic code blocks > that can be called by any other code block regardless of programming language > -- but apparently I don't. I have this > > #+name: my-random-gen > #+he

Calling/using named babel code blocks

2019-12-18 Thread Lawrence Bottorff
I thought I understood "metaprogramming," i.e., creating generic code blocks that can be called by any other code block regardless of programming language -- but apparently I don't. I have this #+name: my-random-gen #+header: :var n=0 :var lim=0 #+BEGIN_SRC emacs-lisp (loop repeat n collect (rand