From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lawrence Bottorff Subject: Re: Scheme babel error Date: Tue, 30 Aug 2016 14:07:11 -0400 Message-ID: References: <871t16mb3h.fsf@alphaville.usersys.redhat.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=94eb2c09c7e8915194053b4dd9be Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:34421) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1benRK-0003VO-Qi for emacs-orgmode@gnu.org; Tue, 30 Aug 2016 14:07:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1benRJ-0003JI-1t for emacs-orgmode@gnu.org; Tue, 30 Aug 2016 14:07:14 -0400 Received: from mail-oi0-x22a.google.com ([2607:f8b0:4003:c06::22a]:34087) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1benRI-0003J8-RC for emacs-orgmode@gnu.org; Tue, 30 Aug 2016 14:07:12 -0400 Received: by mail-oi0-x22a.google.com with SMTP id l203so37342048oib.1 for ; Tue, 30 Aug 2016 11:07:12 -0700 (PDT) In-Reply-To: <871t16mb3h.fsf@alphaville.usersys.redhat.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Nick Dokos Cc: emacs-orgmode Mailinglist --94eb2c09c7e8915194053b4dd9be Content-Type: text/plain; charset=UTF-8 Actually, I found that thread ( https://lists.gnu.org/archive/html/emacs-orgmode/2015-09/msg00390.html) and looked thrugh it (not as good as "looking through" it), but didn't make the connection that it was because of the boolean -- again. What threw me was how this time it seemed to just be a source block execute of the function, whereas before it was the actual code -- as if the problem in ob-scheme.el had escaped and hidden somewhere new. How does one make an official bug report and/or fix? On Tue, Aug 30, 2016 at 1:16 PM, Nick Dokos wrote: > Lawrence Bottorff writes: > > > I'm using Racket with Geiser and I get this error: > > > > executing Scheme code block... > > => #f > > org-babel-scheme-execute-with-geiser: Invalid read syntax: "#" > > > > when in an org-mode file this code > > > > #+begin_src scheme :exports both :session ch3 > > (define (bool-imply2 x y) > > (or (not x) y)) > > #+end_src > > > > is run (C-c-c) > > > > #+BEGIN_SRC scheme :session ch3 > > (bool-imply2 #t #f) > > #+END_SRC > > > > In the Racket "ch3" REPL session (bool-imply2 #t #f) works fine. I > discovered this problem when I first > > tried a simple export to HTML of the buffer. It seems to not like the > second boolean parameter. So > > switching the parameters then complains about #t . What might be going > on? BTW, does an export try to > > "run" all the code blocks, i.e., why did I find this when I was > exporting to HTML? > > > > LB > > > > Aargh - somebody (maybe you?) had run into this a long time ago and I > had suggested a possible fix, but with the demise of the gmane site, I > cannot find the thread - how do people search the ML nowadays? > > In any case, there is a basic error in ob-scheme.el, line 176 (at > least in the version that I have): > > ... > (setq result (if (or (string= result "#") > (string= result "#")) > nil > (read result))))) ;;;<<<<<<<<<<<<<<<< > ... > > The (read result) is bogus: it tries to use the emacs lisp reader to > parse a string that contains a scheme expression. > > IIRC, I suggested changing it to just result: > > ... > (setq result (if (or (string= result "#") > (string= result "#")) > nil > result)))) > ... > > but I didn't (and still don't) know if that breaks anything else. > > Plus I'm on a machine that doesn't have geiser so I can't even test the > basic "fix", > so I hope I've got it right. I'll try to follow up tonight from a machine > that has > geiser installed. > > -- > Nick > > > --94eb2c09c7e8915194053b4dd9be Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Actually, I found that thread (https://lists.gnu.o= rg/archive/html/emacs-orgmode/2015-09/msg00390.html) and looked thrugh = it (not as good as "looking through" it), but didn't make the= connection that it was because of the boolean -- again. What threw me was = how this time it seemed to just be a source block execute of the function, = whereas before it was the actual code -- as if the problem in=C2=A0ob-schem= e.el had escaped and hidden somewhere new.

How does one = make an official bug report and/or fix?

On Tue, Aug 30, 2016 at 1:16 PM, Nick Dok= os <ndokos@gmail.com> wrote:
Lawrence Bottorff <borgauf@gmail.com> writes:

> I'm using Racket with Geiser and I get this error:
>
> executing Scheme code block...
> =3D> #f
> org-babel-scheme-execute-with-geiser: Invalid read syntax: "= #"
>
> when in an org-mode file this code
>
> #+begin_src scheme :exports both :session ch3
> (define (bool-imply2 x y)
> =C2=A0 (or (not x) y))
> #+end_src
>
> is run (C-c-c)
>
> #+BEGIN_SRC scheme :session ch3
> (bool-imply2 #t #f)
> #+END_SRC
>
> In the Racket "ch3" REPL session=C2=A0(bool-imply2 #t #f) wo= rks fine. I discovered this problem when I first
> tried a simple export to HTML of the buffer. It seems to not like the = second boolean parameter. So
> switching the parameters then complains about #t . What might be going= on? BTW, does an export try to
> "run" all the code blocks, i.e., why did I find this when I = was exporting to HTML?
>
> LB
>

Aargh - somebody (maybe you?) had run into this a long time ago= and I
had suggested a possible fix, but with the demise of the gmane site, I
cannot find the thread - how do people search the ML nowadays?

In any case, there is a basic error in ob-scheme.el, line 176 (at
least in the version that I have):

=C2=A0 =C2=A0 =C2=A0 =C2=A0 ...
=C2=A0 =C2=A0 =C2=A0 =C2=A0 (setq result (if (or (string=3D result "#&= lt;void>")
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(string=3D result "#<unspecified>= "))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0nil
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0(read result)))))=C2=A0 =C2=A0;;;<<<<<<<<= <<<<<<<<
=C2=A0 =C2=A0 =C2=A0 =C2=A0 ...

The (read result) is bogus: it tries to use the emacs lisp reader to
parse a string that contains a scheme expression.

IIRC, I suggested changing it to just result:

=C2=A0 =C2=A0 =C2=A0 =C2=A0 ...
=C2=A0 =C2=A0 =C2=A0 =C2=A0 (setq result (if (or (string=3D result "#&= lt;void>")
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(string=3D result "#<unspecified>= "))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0nil
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0result))))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 ...

but I didn't (and still don't) know if that breaks anything else.
Plus I'm on a machine that doesn't have geiser so I can't even = test the basic "fix",
so I hope I've got it right. I'll try to follow up tonight from a m= achine that has
geiser installed.

--
Nick



--94eb2c09c7e8915194053b4dd9be--