#+title: Scope of properties as variables for babel blocks
* Overview
I have the following scenario in mind: =func1= and =func2= are two
functions that can be executed in two modes: =foo= and =bar=. Each
mode yields a different set of results, that have to be discussed,
separately, in two different subtrees.
The goal is to have one subtree where they are executed in one mode
and a second subtree for the other mode.
The functions are defined in a dedicated [[Code][subtree]].
* Bar setting
Now, I want to execute the function in =bar= mode:
#+PROPERTY: var mode="bar"
#+CALL: func1()
#+RESULTS:
: default
#+CALL: func2()
#+RESULTS:
: default
* Foo setting
In this node I want to execute the functions in =foo= mode:
#+PROPERTY: var mode="foo"
#+CALL: func1()
#+RESULTS:
: default
#+CALL: func2()
#+RESULTS:
: default
* Code
#+name: func1
#+begin_src python
return mode
#+end_src
#+RESULTS: func1
: foo
#+name: func2
#+begin_src python
return mode
#+end_src
#+RESULTS: func2
: default-val
* Question:
How can I implement this kind of workflow in a reproducible org mode document?