emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] Another babel scheme issue


From: Lawrence Bottorff
Subject: [O] Another babel scheme issue
Date: Wed, 16 Sep 2015 15:12:11 -0400

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]