[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: org-babel guile source block bug in handling multiple values
From: |
Ihor Radchenko |
Subject: |
Re: org-babel guile source block bug in handling multiple values |
Date: |
Thu, 09 Mar 2023 13:10:56 +0000 |
Zelphir Kaltstahl <zelphirkaltstahl@posteo.de> writes:
> ~~~~START~~~~
> #+name: python-imports
> #+begin_src python :python /usr/bin/python3 :results output replace drawer
> :var x=4
> import math
>
> y = math.sqrt(x)
> # print(y)
> #+end_src
>
> #+name: python-usage
> #+begin_src python :python /usr/bin/python3 :return :noweb strip-export
> :results value replace drawer
> <<python-imports>>
>
> print("y: {}".format(y))
> #+end_src
> ~~~~~END~~~~~
>
> Unfortunately, this example does not seem to work at all, but for a different
> reason:
>
> It seems that using any Python source block with :var header args via :noweb
> does not work, as it then behaves in the way, that it merely pasted the
> included
> source block, without first putting in the :var values into the variables. I
> get
> errors about those :var variables being undefined, of course, since they are
> on
> the included source block, not on the including one:
>
> ~~~~START: *Org-Babel Error Output*~~~~
> Traceback (most recent call last):
> File "<stdin>", line 10, in <module>
> File "<stdin>", line 5, in main
> NameError: name 'x' is not defined
> [ Babel evaluation exited with code 1 ]
> ~~~~~END~~~~~
This is expected. Noweb includes the src block code without altering it.
See 16.11 Noweb Reference Syntax
We may probably clarify this in the manual. Would it be helpful?
--
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>
- Re: org-babel guile source block bug in handling multiple values, (continued)
- Re: org-babel guile source block bug in handling multiple values, Zelphir Kaltstahl, 2023/03/08
- [BUG] Inconsistent global/local :var assignments in ob-* for lisps and non-lisps (was: org-babel guile source block bug in handling multiple values), Ihor Radchenko, 2023/03/09
- Re: [BUG] Inconsistent global/local :var assignments in ob-* for lisps and non-lisps (was: org-babel guile source block bug in handling multiple values), Zelphir Kaltstahl, 2023/03/10
- Re: [BUG] Inconsistent global/local :var assignments in ob-* for lisps and non-lisps (was: org-babel guile source block bug in handling multiple values), Ihor Radchenko, 2023/03/11
- Re: [BUG] Inconsistent global/local :var assignments in ob-* for lisps and non-lisps (was: org-babel guile source block bug in handling multiple values), Zelphir Kaltstahl, 2023/03/11
- Re: [BUG] Inconsistent global/local :var assignments in ob-* for lisps and non-lisps (was: org-babel guile source block bug in handling multiple values), Ihor Radchenko, 2023/03/12
- [PATCH] lisp/ob-scheme.el, Zelphir Kaltstahl, 2023/03/19
- Re: [PATCH] lisp/ob-scheme.el, Ihor Radchenko, 2023/03/22
- Re: [PATCH] lisp/ob-scheme.el, Zelphir Kaltstahl, 2023/03/25
- Re: [PATCH] lisp/ob-scheme.el, Ihor Radchenko, 2023/03/26
- Re: org-babel guile source block bug in handling multiple values,
Ihor Radchenko <=
- Re: org-babel guile source block bug in handling multiple values, Zelphir Kaltstahl, 2023/03/10
- Re: org-babel guile source block bug in handling multiple values, Ihor Radchenko, 2023/03/11
- Re: org-babel guile source block bug in handling multiple values, Ihor Radchenko, 2023/03/09
- Re: org-babel guile source block bug in handling multiple values, Daniel Kraus, 2023/03/09
- Re: org-babel guile source block bug in handling multiple values, Ihor Radchenko, 2023/03/10
- Re: org-babel guile source block bug in handling multiple values, Zelphir Kaltstahl, 2023/03/10
- Re: org-babel guile source block bug in handling multiple values, Zelphir Kaltstahl, 2023/03/07
- Re: org-babel guile source block bug in handling multiple values, Ihor Radchenko, 2023/03/08
Re: org-babel guile source block bug in handling multiple values, Max Nikulin, 2023/03/07
Re: org-babel guile source block bug in handling multiple values, Rudolf Adamkovič, 2023/03/07