emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Another babel scheme issue
@ 2015-09-16 19:12 Lawrence Bottorff
  2015-09-16 19:30 ` Nick Dokos
  0 siblings, 1 reply; 5+ messages in thread
From: Lawrence Bottorff @ 2015-09-16 19:12 UTC (permalink / raw)
  To: emacs-orgmode

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

The patch to ob-scheme.el that Nick Dokos provided is working well. But
another ob-scheme/geiser problem has come up. The code below

#+name: letter
#+header:
#+begin_src scheme :exports both :session ch1
(require 2htdp/batch-io)
(define (letter fst lst signature-name)
  (string-append
   (opening fst)
   "\n\n"
   (body fst lst)
   "\n\n"
   (closing signature-name)))

(define (opening fst)
  (string-append "Dear " fst ","))

(define (body fst lst)
  (string-append
   "We have discovered that all people with the last name " "\n"
   lst " have won our lottery. So, " fst ", " "\n"
   "hurry and pick up your prize."))

(define (closing signature-name)
  (string-append
   "Sincerely,"
   "\n\n"
   signature-name
   "\n"))
#+end_src

comes from How To Design Programs 2nEd, and C-c C-c "compiles" fine when
geiser is set to racket (or chicken). However C- C-c-ing

#+BEGIN_SRC scheme :session ch1
(write-file 'stdout (letter "Matthew" "Fisler" "Felleisen"))
#+END_SRC

produces

#+RESULTS:
: stdout

. . . i,e., no formatted output in my org buffer. However then comes a
geiser DBG (quasi-debug) buffer atop the racket "ch1" buffer:

;; -*- geiser-scheme-implementation: racket -*-
(write-file 'stdout (letter "Matthew" "Fisler" "Felleisen"))

=> stdout

Dear Matthew,

We have discovered that all people with the last name
Fisler have won our lottery. So, Matthew,
hurry and pick up your prize.

Sincerely,

Felleisen

. . . so odd how this is the correct output formatting, but is not inserted
into my org buffer; instead, given to me as a debug screen. Also, running
this code in chicken scheme (without the racket require line, rather a
(print ...) wrapped around letter's string-append form) produces the same
behavior. It would seem ob-scheme and geiser aren't liking standard output
printing. But then running with no require/print formatting works fine, but
of course without print formatting:

#+RESULTS:
: "Dear Matthew,\n\nWe have discovered that all people with the last name
\nFisler have won our lottery. So, Matthew, \nhurry and pick up your
prize.\n\nSincerely,\n\nFelleisen\n"

This isn't a huge issue, but I'd like to figure this out before I show it
to my students.

LB

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

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

end of thread, other threads:[~2015-09-16 23:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-16 19:12 Another babel scheme issue Lawrence Bottorff
2015-09-16 19:30 ` Nick Dokos
2015-09-16 21:13   ` Lawrence Bottorff
2015-09-16 21:56     ` Nick Dokos
2015-09-16 23:26       ` Lawrence Bottorff

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).