From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lawrence Bottorff Subject: Another babel scheme issue Date: Wed, 16 Sep 2015 15:12:11 -0400 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=047d7b3a89ae5d6cb2051fe213c5 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:39959) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZcI7q-0007Cn-Q4 for emacs-orgmode@gnu.org; Wed, 16 Sep 2015 15:12:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZcI7p-0002i9-LG for emacs-orgmode@gnu.org; Wed, 16 Sep 2015 15:12:14 -0400 Received: from mail-la0-x22e.google.com ([2a00:1450:4010:c03::22e]:33605) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZcI7p-0002hs-A7 for emacs-orgmode@gnu.org; Wed, 16 Sep 2015 15:12:13 -0400 Received: by lamp12 with SMTP id p12so134371864lam.0 for ; Wed, 16 Sep 2015 12:12:11 -0700 (PDT) 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org --047d7b3a89ae5d6cb2051fe213c5 Content-Type: text/plain; charset=UTF-8 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 --047d7b3a89ae5d6cb2051fe213c5 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
The patch to ob-scheme.el that Nick Dokos provided is work= ing well. But another ob-scheme/geiser problem has come up. The code below<= div>
#+name: letter
#+header:
#+begi= n_src scheme :exports both :session ch1
(require 2htdp/batch-io)<= /div>
(define (letter fst lst signature-name)
=C2=A0 (string-= append
=C2=A0 =C2=A0(opening fst)
=C2=A0 =C2=A0"\n= \n"
=C2=A0 =C2=A0(body fst lst)
=C2=A0 =C2=A0"= ;\n\n"
=C2=A0 =C2=A0(closing signature-name)))
(define (opening fst)
=C2=A0 (string-append "Dea= r " fst ","))

(define (body fst lst= )
=C2=A0 (string-append
=C2=A0 =C2=A0"We have disc= overed that all people with the last name " "\n"
= =C2=A0 =C2=A0lst " have won our lottery. So, " fst ", "= "\n"
=C2=A0 =C2=A0"hurry and pick up your prize.&= quot;))

(define (closing signature-name)
=C2=A0 (string-append
=C2=A0 =C2=A0"Sincerely,"
<= div>=C2=A0 =C2=A0"\n\n"
=C2=A0 =C2=A0signature-name
=C2=A0 =C2=A0"\n"))
#+end_src
comes from How To Design Programs 2nEd, and C-c C-c "comp= iles" fine when geiser is set to racket (or chicken). However C- C-c-i= ng

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

= produces=C2=A0

#+RESULTS:
: stdout<= /div>

. . . i,e., no formatted output in my org bu= ffer. 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"))

=3D> stdout

Dear Matthew,

=
We have discovered that all people with the last name=C2=A0
Fisler have won our lottery. So, Matthew,=C2=A0
hurry and p= ick 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-sch= eme and geiser aren't liking standard output printing. But then running= with no require/print formatting works fine, but of course without print f= ormatting:

#+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\nSince= rely,\n\nFelleisen\n"

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

LB


<= br>
--047d7b3a89ae5d6cb2051fe213c5--