emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Lawrence Bottorff <borgauf@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Another babel scheme issue
Date: Wed, 16 Sep 2015 15:12:11 -0400	[thread overview]
Message-ID: <CAFAhFSVg-GYOoPtgmDZU_dpEnMEbMiGqNs=mTetFMtCs3dbdgg@mail.gmail.com> (raw)

[-- 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 --]

             reply	other threads:[~2015-09-16 19:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-16 19:12 Lawrence Bottorff [this message]
2015-09-16 19:30 ` Another babel scheme issue Nick Dokos
2015-09-16 21:13   ` Lawrence Bottorff
2015-09-16 21:56     ` Nick Dokos
2015-09-16 23:26       ` Lawrence Bottorff

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAFAhFSVg-GYOoPtgmDZU_dpEnMEbMiGqNs=mTetFMtCs3dbdgg@mail.gmail.com' \
    --to=borgauf@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).