Open bremner opened 11 months ago
Note, that there was a similar/equivalent problem in org babel Scheme before, that is now fixed:
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=d97ba5ba5
I am guessing you are experiencing similar problems as I was, when I wanted to use source blocks in literate programming and relied on bindings being in scope, but they were not, due to being let
-wrapped.
Zelphir Kaltstahl @.***> writes:
Note, that there was a similar/equivalent problem in org babel Scheme before, that is now fixed:
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=d97ba5ba5
I am guessing you are experiencing similar problems as I was, when I wanted to use source blocks in literate programming and relied on bindings being in scope, but they were not, due to being
let
-wrapped.
That makes sense. Since I'm not using header arg variables, I could not see the purpose of the let. A similar fix should be possible here.
The purpose of the let
wrapper is to turn the contents of the code block into single expression giving a value to be write
n out as the result of the block. (And yes, additionally the let
expression also creates a local definition context for any header arg variables to be defined.)
As that wrapper only gets inserted when the requested result type for the block is value
, one option for the use case might be to simply change the result type to output
for all racket
blocks in a file to be tangled:
#+PROPERTY: header-args:racket :results output
Another alternative is to override the template used to construct the program (part) for a block so that no let
wrapper is included:
#+PROPERTY: header-args:racket :program '(lines prologue define-vars :body epilogue)
When using org for literate programming, when I tangle blocks, I don't expect them wrapped in
for example
currently exports to
I guess this has something to do with execution results, but tangling needs to be closer to "verbatim" to be useful for me.