emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to supply multiples of a custom src block header arg


From: George Mauer
Subject: How to supply multiples of a custom src block header arg
Date: Sun, 31 May 2020 08:36:53 -0500

It would seem that `:var` in src blocks gets special treatment.

I am hacking on ob-racket trying to add the ability to require from a header (the `:results value` mode wraps everything in a `let` so you need something special to put requires at the top level).

I do this

```
#+begin_src racket :require rebellion/collection/list :require rebellion/streaming/transducer :var foo=1 :var bar=2
  (transduce (in-range 1 10)
             (folding + 0)
             #:into into-list)
#+end_src
```

Note there’s two `:var` headers and two custom `:require` headers

Yet when in my `org-babel-execute:racket` function I log `params` 

```
(defun org-babel-execute:racket (body params)
  "Executes a Racket code block."
  (message "==params %s" params)
  ...
```

I get

```
==params ((:var foo . 1) (:var bar . 2) (:colname-names) (:rowname-names) (:result-params replace) (:result-type . value) (:results . replace) (:exports . code) (:session . none) (:cache . no) (:noweb . no) (:hlines . no) (:tangle . no) (:lang . racket) (:require . rebellion/streaming/transducer))
```

Note that both `:var` headers have corresponding cons cells but only the last `:require` header does

What is causing this behavior and how would I modify it?

reply via email to

[Prev in Thread] Current Thread [Next in Thread]