Re: org-babel guile source block bug in handling multiple values

2023-06-02 Thread Ihor Radchenko
Ihor Radchenko writes: > Zelphir Kaltstahl writes: > >>> 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? >> I think it would be helpful. I merely tried Python,

Re: org-babel guile source block bug in handling multiple values

2023-03-11 Thread Ihor Radchenko
Zelphir Kaltstahl writes: >> 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? > I think it would be helpful. I merely tried Python, because it was at hand > and >

Re: org-babel guile source block bug in handling multiple values

2023-03-10 Thread Ihor Radchenko
Daniel Kraus writes: > If I could freely choose if a :var declaration in one source block > should create a global variable for all other blocks in this session, > I would say making it only available in the defining source block > is more natural (i.e. use let instead of def). You can always

Re: org-babel guile source block bug in handling multiple values

2023-03-10 Thread Zelphir Kaltstahl
On 3/9/23 14:11, Ihor Radchenko wrote: Zelphir Kaltstahl writes: OK, to wrap up (ha!), I want to ask: (q1) What is a rationale, if any, behind the let-wrapping? It makes sense in ob-emacs-lisp to not litter global Emacs state. In other ob-* lisp backends, I am not sure. I am CCing Daniel,

Re: org-babel guile source block bug in handling multiple values

2023-03-10 Thread Zelphir Kaltstahl
On 3/9/23 14:10, Ihor Radchenko wrote: Zelphir Kaltstahl 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

Re: org-babel guile source block bug in handling multiple values

2023-03-09 Thread Daniel Kraus
Ihor Radchenko writes: > Zelphir Kaltstahl writes: >> (q1) What is a rationale, if any, behind the let-wrapping? > > It makes sense in ob-emacs-lisp to not litter global Emacs state. > In other ob-* lisp backends, I am not sure. > I am CCing Daniel, the maintainer of ob-clojure (we have no

Re: org-babel guile source block bug in handling multiple values

2023-03-09 Thread Ihor Radchenko
Zelphir Kaltstahl writes: > OK, to wrap up (ha!), I want to ask: > > (q1) What is a rationale, if any, behind the let-wrapping? It makes sense in ob-emacs-lisp to not litter global Emacs state. In other ob-* lisp backends, I am not sure. I am CCing Daniel, the maintainer of ob-clojure (we have

Re: org-babel guile source block bug in handling multiple values

2023-03-09 Thread Ihor Radchenko
Zelphir Kaltstahl 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

Re: org-babel guile source block bug in handling multiple values

2023-03-08 Thread Zelphir Kaltstahl
On 3/8/23 20:38, Bruno Barbier wrote: Hi Zelphir, Zelphir Kaltstahl writes: On 3/7/23 20:52, Bruno Barbier wrote: Also thanks for the idea with sessions + separate import source block. I thought that should work, but apparently that also has the same error, when running for the first time:

Re: org-babel guile source block bug in handling multiple values

2023-03-08 Thread Bruno Barbier
Hi Zelphir, Zelphir Kaltstahl writes: > On 3/7/23 20:52, Bruno Barbier wrote: > Also thanks for the idea with sessions + separate import source block. I > thought > that should work, but apparently that also has the same error, when running > for > the first time: > > ... Oh, I see. I

Re: org-babel guile source block bug in handling multiple values

2023-03-08 Thread Ihor Radchenko
Zelphir Kaltstahl writes: > Actually, now that I think about it, the whole problem is gone, when > replacing > the wrapping let with 2 separate (define ...), which I originally thought org > would do: > ... > Is there a reason it has to be wrapped in a let, instead of simply define-ing > the

Re: org-babel guile source block bug in handling multiple values

2023-03-07 Thread Zelphir Kaltstahl
On 3/7/23 20:52, Bruno Barbier wrote: Zelphir Kaltstahl writes: If org merely wraps in a `let`, it should not notice any of the multiple values business, because that is something done internally in `let-values`. The "let", to define the org variables, ends up putting the "import" inside

Re: org-babel guile source block bug in handling multiple values

2023-03-07 Thread Zelphir Kaltstahl
On 3/7/23 20:52, Bruno Barbier wrote: Zelphir Kaltstahl writes: If org merely wraps in a `let`, it should not notice any of the multiple values business, because that is something done internally in `let-values`. The "let", to define the org variables, ends up putting the "import" inside

Re: org-babel guile source block bug in handling multiple values

2023-03-07 Thread Rudolf Adamkovič
Zelphir Kaltstahl writes: > There seems to be an issue with returning multiple values, By the way, (Common) Lisp also has problems with multiple values in Org, as I have recently learned in a discussion with the author of SLY (the modern alternative to SLIME), João Távora. He says: > But this

Re: org-babel guile source block bug in handling multiple values

2023-03-07 Thread Bruno Barbier
Zelphir Kaltstahl writes: > If org merely wraps in a `let`, it should not notice any of the multiple > values > business, because that is something done internally in `let-values`. > The "let", to define the org variables, ends up putting the "import" inside the scheme expression, like this:

Re: org-babel guile source block bug in handling multiple values

2023-03-07 Thread Max Nikulin
On 07/03/2023 18:27, Zelphir Kaltstahl wrote: because somehow there is no ob-racket and I think I would need that. See the following thread for a couple of links. Disclaimer: I have never used racket, so I do not know real state of affairs.

Re: org-babel guile source block bug in handling multiple values

2023-03-07 Thread Zelphir Kaltstahl
On 3/7/23 15:36, Ihor Radchenko wrote: Zelphir Kaltstahl writes: * Multiple values involving =:var= variables #+begin_src scheme :eval query-export :results output replace drawer :var x=1 :var y=2 (import (except (rnrs base) error vector-map) (only (guile) lambda*

Re: org-babel guile source block bug in handling multiple values

2023-03-07 Thread Ihor Radchenko
Zelphir Kaltstahl writes: > * Multiple values involving =:var= variables > > #+begin_src scheme :eval query-export :results output replace drawer :var x=1 > :var y=2 > (import (except (rnrs base) error vector-map) > (only (guile) >lambda* >λ) >