emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Scheme babel error
@ 2016-08-30 16:02 Lawrence Bottorff
  2016-08-30 17:16 ` Nick Dokos
  0 siblings, 1 reply; 4+ messages in thread
From: Lawrence Bottorff @ 2016-08-30 16:02 UTC (permalink / raw)
  To: emacs-orgmode Mailinglist

[-- Attachment #1: Type: text/plain, Size: 761 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 1093 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Scheme babel error
  2016-08-30 16:02 Scheme babel error Lawrence Bottorff
@ 2016-08-30 17:16 ` Nick Dokos
  2016-08-30 18:07   ` Lawrence Bottorff
  0 siblings, 1 reply; 4+ messages in thread
From: Nick Dokos @ 2016-08-30 17:16 UTC (permalink / raw)
  To: emacs-orgmode

Lawrence Bottorff <borgauf@gmail.com> 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 "#<void>")
			     (string= result "#<unspecified>"))
			 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 "#<void>")
			     (string= result "#<unspecified>"))
			 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Scheme babel error
  2016-08-30 17:16 ` Nick Dokos
@ 2016-08-30 18:07   ` Lawrence Bottorff
  2016-08-31 16:38     ` Nick Dokos
  0 siblings, 1 reply; 4+ messages in thread
From: Lawrence Bottorff @ 2016-08-30 18:07 UTC (permalink / raw)
  To: Nick Dokos; +Cc: emacs-orgmode Mailinglist

[-- Attachment #1: Type: text/plain, Size: 2741 bytes --]

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 <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...
> > => #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 "#<void>")
>                              (string= result "#<unspecified>"))
>                          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 "#<void>")
>                              (string= result "#<unspecified>"))
>                          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
>
>
>

[-- Attachment #2: Type: text/html, Size: 3876 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Scheme babel error
  2016-08-30 18:07   ` Lawrence Bottorff
@ 2016-08-31 16:38     ` Nick Dokos
  0 siblings, 0 replies; 4+ messages in thread
From: Nick Dokos @ 2016-08-31 16:38 UTC (permalink / raw)
  To: emacs-orgmode

Lawrence Bottorff <borgauf@gmail.com> writes:

> 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?
>

I pushed the simple (read result)-->result fix to maint and merged it
into master as well.  It's probably not the end of the story, but it
does seem to make things better, so keeping fingers crossed. Try it
out and let me know if you encounter more problems.

Thanks!

> On Tue, Aug 30, 2016 at 1:16 PM, Nick Dokos <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...
>     > => #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 "#<void>")
>                                  (string= result "#<unspecified>"))
>                              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 "#<void>")
>                                  (string= result "#<unspecified>"))
>                              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
>

-- 
Nick

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-08-31 21:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-30 16:02 Scheme babel error Lawrence Bottorff
2016-08-30 17:16 ` Nick Dokos
2016-08-30 18:07   ` Lawrence Bottorff
2016-08-31 16:38     ` Nick Dokos

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).