emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Scheme code block gives false error message
@ 2015-09-12  1:23 Lawrence Bottorff
  2015-09-13  4:03 ` Lawrence Bottorff
  0 siblings, 1 reply; 18+ messages in thread
From: Lawrence Bottorff @ 2015-09-12  1:23 UTC (permalink / raw)
  To: emacs-orgmode

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

When I run this code:

#+BEGIN_SRC scheme :session ch1 :exports both
(define (check-it x)
  (cond
    ((string? x) (string-length x))
    ((number? x) (if (<= x 0) x (sub1 x)))
    ((boolean? x) (if (and #t x) 10 20))
    (else #f)))
#+END_SRC

I get this error message:

org-babel-scheme-execute-with-geiser: Invalid read syntax: "#"

But the Chicken Scheme session has accepted the check-it function just
fine. A stand-alone csi REPL works fine, too. Why, then, do I get this
cryptic error?

LB

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

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

* Re: Scheme code block gives false error message
  2015-09-12  1:23 Scheme code block gives false error message Lawrence Bottorff
@ 2015-09-13  4:03 ` Lawrence Bottorff
  2015-09-13  5:41   ` Nick Dokos
  0 siblings, 1 reply; 18+ messages in thread
From: Lawrence Bottorff @ 2015-09-13  4:03 UTC (permalink / raw)
  To: emacs-orgmode

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

Again, this code

#+BEGIN_SRC scheme :session ch1 :exports both
(define (bool-imply a b)
  (if (or (not a) b) #t #f))
#+END_SRC

gives the error

org-babel-scheme-execute-with-geiser: Invalid read syntax: "#"

and this time attempting to use the function

#+BEGIN_SRC scheme :session ch1 :exports both
(bool-imply #t #f)
#+END_SRC

produces no #RESULTS: block, rather, again, the error (in Messages buffer)

org-babel-scheme-execute-with-geiser: Invalid read syntax: "#"

even though this is perfectly healthy code, and it works in the
accompanying "ch1" REPL. Any ideas what's happening?

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

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

* Re: Scheme code block gives false error message
  2015-09-13  4:03 ` Lawrence Bottorff
@ 2015-09-13  5:41   ` Nick Dokos
  2015-09-13 13:14     ` Lawrence Bottorff
  0 siblings, 1 reply; 18+ messages in thread
From: Nick Dokos @ 2015-09-13  5:41 UTC (permalink / raw)
  To: emacs-orgmode

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

Lawrence Bottorff <borgauf@gmail.com> writes:

> Again, this code
>
> #+BEGIN_SRC scheme :session ch1 :exports both
> (define (bool-imply a b)
>   (if (or (not a) b) #t #f))
> #+END_SRC
>
> gives the error
>
> org-babel-scheme-execute-with-geiser: Invalid read syntax: "#"
>
> and this time attempting to use the function
>
> #+BEGIN_SRC scheme :session ch1 :exports both
> (bool-imply #t #f)
> #+END_SRC
>
> produces no #RESULTS: block, rather, again, the error (in Messages buffer)
>
> org-babel-scheme-execute-with-geiser: Invalid read syntax: "#"
>
> even though this is perfectly healthy code, and it works in the accompanying "ch1" REPL. Any ideas what's happening?
>

Your previous example worked for me (both with master and maint - I use
guile, not chicken, but that should make no difference).

But this one fails with the "Invalid read syntax error" and with the
attached backtrace (running on maint - master gave the same error but
I didn't get a backtrace).


[-- Attachment #2: backtrace --]
[-- Type: text/plain, Size: 24868 bytes --]

  read("#f")
  (if (or (string= result "#<void>") (string= result "#<unspecified>")) nil (read result))
  (setq result (if (or (string= result "#<void>") (string= result "#<unspecified>")) nil (read result)))
  (let ((repl-buffer (save-current-buffer (org-babel-scheme-get-repl impl repl)))) (if (not (eq impl (org-babel-scheme-get-buffer-impl (current-buffer)))) (progn (message "Implementation mismatch: %s (%s) %s (%s)" impl (symbolp impl) (org-babel-scheme-get-buffer-impl (current-buffer)) (symbolp (org-babel-scheme-get-buffer-impl (current-buffer)))))) (setq geiser-repl--repl repl-buffer) (setq geiser-impl--implementation nil) (setq result (if noninteractive (let ((original-message (symbol-function (quote message))) (current-message nil)) (unwind-protect (progn (defalias (quote message) (function ...)) (geiser-eval-region (point-min) (point-max)) current-message) (fset (quote message) original-message))) (progn (geiser-eval-region (point-min) (point-max)) (current-message)))) (setq result (if (and (stringp result) (equal (substring result 0 3) "=> ")) (replace-regexp-in-string "^=> " "" result) "\"An error occurred.\"")) (if (not repl) (progn (save-current-buffer (set-buffer repl-buffer) (geiser-repl-exit)) (set-process-query-on-exit-flag (get-buffer-process repl-buffer) nil) (kill-buffer repl-buffer))) (setq result (if (or (string= result "#<void>") (string= result "#<unspecified>")) nil (read result))))
  (progn (insert (format ";; -*- geiser-scheme-implementation: %s -*-" impl)) (newline) (insert (if output (format "(with-output-to-string (lambda () %s))" code) code)) (geiser-mode) (let ((repl-buffer (save-current-buffer (org-babel-scheme-get-repl impl repl)))) (if (not (eq impl (org-babel-scheme-get-buffer-impl (current-buffer)))) (progn (message "Implementation mismatch: %s (%s) %s (%s)" impl (symbolp impl) (org-babel-scheme-get-buffer-impl (current-buffer)) (symbolp (org-babel-scheme-get-buffer-impl (current-buffer)))))) (setq geiser-repl--repl repl-buffer) (setq geiser-impl--implementation nil) (setq result (if noninteractive (let ((original-message (symbol-function ...)) (current-message nil)) (unwind-protect (progn (defalias ... ...) (geiser-eval-region ... ...) current-message) (fset (quote message) original-message))) (progn (geiser-eval-region (point-min) (point-max)) (current-message)))) (setq result (if (and (stringp result) (equal (substring result 0 3) "=> ")) (replace-regexp-in-string "^=> " "" result) "\"An error occurred.\"")) (if (not repl) (progn (save-current-buffer (set-buffer repl-buffer) (geiser-repl-exit)) (set-process-query-on-exit-flag (get-buffer-process repl-buffer) nil) (kill-buffer repl-buffer))) (setq result (if (or (string= result "#<void>") (string= result "#<unspecified>")) nil (read result)))))
  (unwind-protect (progn (insert (format ";; -*- geiser-scheme-implementation: %s -*-" impl)) (newline) (insert (if output (format "(with-output-to-string (lambda () %s))" code) code)) (geiser-mode) (let ((repl-buffer (save-current-buffer (org-babel-scheme-get-repl impl repl)))) (if (not (eq impl (org-babel-scheme-get-buffer-impl (current-buffer)))) (progn (message "Implementation mismatch: %s (%s) %s (%s)" impl (symbolp impl) (org-babel-scheme-get-buffer-impl (current-buffer)) (symbolp (org-babel-scheme-get-buffer-impl ...))))) (setq geiser-repl--repl repl-buffer) (setq geiser-impl--implementation nil) (setq result (if noninteractive (let ((original-message ...) (current-message nil)) (unwind-protect (progn ... ... current-message) (fset ... original-message))) (progn (geiser-eval-region (point-min) (point-max)) (current-message)))) (setq result (if (and (stringp result) (equal (substring result 0 3) "=> ")) (replace-regexp-in-string "^=> " "" result) "\"An error occurred.\"")) (if (not repl) (progn (save-current-buffer (set-buffer repl-buffer) (geiser-repl-exit)) (set-process-query-on-exit-flag (get-buffer-process repl-buffer) nil) (kill-buffer repl-buffer))) (setq result (if (or (string= result "#<void>") (string= result "#<unspecified>")) nil (read result))))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))
  (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (insert (format ";; -*- geiser-scheme-implementation: %s -*-" impl)) (newline) (insert (if output (format "(with-output-to-string (lambda () %s))" code) code)) (geiser-mode) (let ((repl-buffer (save-current-buffer (org-babel-scheme-get-repl impl repl)))) (if (not (eq impl (org-babel-scheme-get-buffer-impl ...))) (progn (message "Implementation mismatch: %s (%s) %s (%s)" impl (symbolp impl) (org-babel-scheme-get-buffer-impl ...) (symbolp ...)))) (setq geiser-repl--repl repl-buffer) (setq geiser-impl--implementation nil) (setq result (if noninteractive (let (... ...) (unwind-protect ... ...)) (progn (geiser-eval-region ... ...) (current-message)))) (setq result (if (and (stringp result) (equal ... "=> ")) (replace-regexp-in-string "^=> " "" result) "\"An error occurred.\"")) (if (not repl) (progn (save-current-buffer (set-buffer repl-buffer) (geiser-repl-exit)) (set-process-query-on-exit-flag (get-buffer-process repl-buffer) nil) (kill-buffer repl-buffer))) (setq result (if (or (string= result "#<void>") (string= result "#<unspecified>")) nil (read result))))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))
  (let ((temp-buffer (generate-new-buffer " *temp*"))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (insert (format ";; -*- geiser-scheme-implementation: %s -*-" impl)) (newline) (insert (if output (format "(with-output-to-string (lambda () %s))" code) code)) (geiser-mode) (let ((repl-buffer (save-current-buffer ...))) (if (not (eq impl ...)) (progn (message "Implementation mismatch: %s (%s) %s (%s)" impl ... ... ...))) (setq geiser-repl--repl repl-buffer) (setq geiser-impl--implementation nil) (setq result (if noninteractive (let ... ...) (progn ... ...))) (setq result (if (and ... ...) (replace-regexp-in-string "^=> " "" result) "\"An error occurred.\"")) (if (not repl) (progn (save-current-buffer ... ...) (set-process-query-on-exit-flag ... nil) (kill-buffer repl-buffer))) (setq result (if (or ... ...) nil (read result))))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))))
  (let ((result nil)) (let ((temp-buffer (generate-new-buffer " *temp*"))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (insert (format ";; -*- geiser-scheme-implementation: %s -*-" impl)) (newline) (insert (if output (format "(with-output-to-string (lambda () %s))" code) code)) (geiser-mode) (let ((repl-buffer ...)) (if (not ...) (progn ...)) (setq geiser-repl--repl repl-buffer) (setq geiser-impl--implementation nil) (setq result (if noninteractive ... ...)) (setq result (if ... ... "\"An error occurred.\"")) (if (not repl) (progn ... ... ...)) (setq result (if ... nil ...)))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))) result)
  org-babel-scheme-execute-with-geiser("(bool-imply #t #f)" nil guile "ch1")
  (let* ((result-type (cdr (assoc :result-type params))) (impl (or (if (cdr (assoc :scheme params)) (progn (intern (cdr ...)))) geiser-default-implementation (car geiser-active-implementations))) (session (org-babel-scheme-make-session-name source-buffer-name (cdr (assoc :session params)) impl)) (full-body (org-babel-expand-body:scheme body params))) (org-babel-scheme-execute-with-geiser full-body (string= result-type "output") impl (and (not (string= session "none")) session)))
  (org-babel-reassemble-table (let* ((result-type (cdr (assoc :result-type params))) (impl (or (if (cdr (assoc :scheme params)) (progn (intern ...))) geiser-default-implementation (car geiser-active-implementations))) (session (org-babel-scheme-make-session-name source-buffer-name (cdr (assoc :session params)) impl)) (full-body (org-babel-expand-body:scheme body params))) (org-babel-scheme-execute-with-geiser full-body (string= result-type "output") impl (and (not (string= session "none")) session))) (org-babel-pick-name (cdr (assoc :colname-names params)) (cdr (assoc :colnames params))) (org-babel-pick-name (cdr (assoc :rowname-names params)) (cdr (assoc :rownames params))))
  (save-excursion (org-babel-reassemble-table (let* ((result-type (cdr (assoc :result-type params))) (impl (or (if (cdr ...) (progn ...)) geiser-default-implementation (car geiser-active-implementations))) (session (org-babel-scheme-make-session-name source-buffer-name (cdr (assoc :session params)) impl)) (full-body (org-babel-expand-body:scheme body params))) (org-babel-scheme-execute-with-geiser full-body (string= result-type "output") impl (and (not (string= session "none")) session))) (org-babel-pick-name (cdr (assoc :colname-names params)) (cdr (assoc :colnames params))) (org-babel-pick-name (cdr (assoc :rowname-names params)) (cdr (assoc :rownames params)))))
  (let* ((source-buffer (current-buffer)) (source-buffer-name (replace-regexp-in-string "^ ?\\*\\([^*]+\\)\\*" "\\1" (buffer-name source-buffer)))) (save-excursion (org-babel-reassemble-table (let* ((result-type (cdr (assoc :result-type params))) (impl (or (if ... ...) geiser-default-implementation (car geiser-active-implementations))) (session (org-babel-scheme-make-session-name source-buffer-name (cdr ...) impl)) (full-body (org-babel-expand-body:scheme body params))) (org-babel-scheme-execute-with-geiser full-body (string= result-type "output") impl (and (not (string= session "none")) session))) (org-babel-pick-name (cdr (assoc :colname-names params)) (cdr (assoc :colnames params))) (org-babel-pick-name (cdr (assoc :rowname-names params)) (cdr (assoc :rownames params))))))
  org-babel-execute:scheme("(bool-imply #t #f)" ((:comments . "") (:shebang . "") (:cache . "no") (:padline . "") (:noweb . "no") (:tangle . "no") (:exports . "both") (:results . "replace") (:hlines . "no") (:session . "ch1") (:result-type . value) (:result-params "replace") (:rowname-names) (:colname-names)))
  funcall(org-babel-execute:scheme "(bool-imply #t #f)" ((:comments . "") (:shebang . "") (:cache . "no") (:padline . "") (:noweb . "no") (:tangle . "no") (:exports . "both") (:results . "replace") (:hlines . "no") (:session . "ch1") (:result-type . value) (:result-params "replace") (:rowname-names) (:colname-names)))
  (let ((result (funcall cmd body params))) (if (and (eq (cdr (assoc :result-type params)) (quote value)) (or (member "vector" result-params) (member "table" result-params)) (not (listp result))) (list (list result)) result))
  (setq result (let ((result (funcall cmd body params))) (if (and (eq (cdr (assoc :result-type params)) (quote value)) (or (member "vector" result-params) (member "table" result-params)) (not (listp result))) (list (list result)) result)))
  (if (member "none" result-params) (progn (funcall cmd body params) (message "result silenced") (setq result nil)) (setq result (let ((result (funcall cmd body params))) (if (and (eq (cdr (assoc :result-type params)) (quote value)) (or (member "vector" result-params) (member "table" result-params)) (not (listp result))) (list (list result)) result))) (if (cdr (assoc :file params)) (progn (if result (progn (let ((temp-file ...) (temp-buffer ...)) (unwind-protect (prog1 ... ...) (and ... ...))))) (setq result (cdr (assoc :file params))))) (if (cdr (assoc :post params)) (progn (let ((*this* (if (cdr ...) (org-babel-result-to-file ... ...) result))) (setq result (org-babel-ref-resolve (cdr (assoc :post params)))) (if (cdr (assoc :file params)) (progn (setq result-params (remove "file" result-params))))))) (org-babel-insert-result result result-params info new-hash indent lang))
  (let ((call-process-region (function (lambda (&rest args) (apply (quote org-babel-tramp-handle-call-process-region) args))))) (let ((lang-check (function (lambda (f) (let (...) (if ... ...)))))) (setq cmd (or (funcall lang-check lang) (funcall lang-check (symbol-name (cdr (assoc lang org-src-lang-modes)))) (error "No org-babel-execute function for %s!" lang)))) (message "executing %s code block%s..." (capitalize lang) (if (nth 4 info) (format " (%s)" (nth 4 info)) "")) (if (member "none" result-params) (progn (funcall cmd body params) (message "result silenced") (setq result nil)) (setq result (let ((result (funcall cmd body params))) (if (and (eq (cdr ...) (quote value)) (or (member "vector" result-params) (member "table" result-params)) (not (listp result))) (list (list result)) result))) (if (cdr (assoc :file params)) (progn (if result (progn (let (... ...) (unwind-protect ... ...)))) (setq result (cdr (assoc :file params))))) (if (cdr (assoc :post params)) (progn (let ((*this* (if ... ... result))) (setq result (org-babel-ref-resolve (cdr ...))) (if (cdr (assoc :file params)) (progn (setq result-params ...)))))) (org-babel-insert-result result result-params info new-hash indent lang)) (run-hooks (quote org-babel-after-execute-hook)) result)
  (unwind-protect (let ((call-process-region (function (lambda (&rest args) (apply (quote org-babel-tramp-handle-call-process-region) args))))) (let ((lang-check (function (lambda (f) (let ... ...))))) (setq cmd (or (funcall lang-check lang) (funcall lang-check (symbol-name (cdr ...))) (error "No org-babel-execute function for %s!" lang)))) (message "executing %s code block%s..." (capitalize lang) (if (nth 4 info) (format " (%s)" (nth 4 info)) "")) (if (member "none" result-params) (progn (funcall cmd body params) (message "result silenced") (setq result nil)) (setq result (let ((result (funcall cmd body params))) (if (and (eq ... ...) (or ... ...) (not ...)) (list (list result)) result))) (if (cdr (assoc :file params)) (progn (if result (progn (let ... ...))) (setq result (cdr (assoc :file params))))) (if (cdr (assoc :post params)) (progn (let ((*this* ...)) (setq result (org-babel-ref-resolve ...)) (if (cdr ...) (progn ...))))) (org-babel-insert-result result result-params info new-hash indent lang)) (run-hooks (quote org-babel-after-execute-hook)) result) (setq call-process-region (quote org-babel-call-process-region-original)))
  (let* ((lang (nth 0 info)) (result-params (cdr (assoc :result-params params))) (body (let* ((c (nthcdr 1 info))) (setcar c (if (org-babel-noweb-p params :eval) (org-babel-expand-noweb-references info) (nth 1 info))))) (dir (cdr (assoc :dir params))) (default-directory (or (and dir (file-name-as-directory (expand-file-name dir))) default-directory)) (org-babel-call-process-region-original (or (and (boundp (quote org-babel-call-process-region-original)) org-babel-call-process-region-original) (symbol-function (quote call-process-region)))) (indent (nth 5 info)) result cmd) (unwind-protect (let ((call-process-region (function (lambda (&rest args) (apply ... args))))) (let ((lang-check (function (lambda ... ...)))) (setq cmd (or (funcall lang-check lang) (funcall lang-check (symbol-name ...)) (error "No org-babel-execute function for %s!" lang)))) (message "executing %s code block%s..." (capitalize lang) (if (nth 4 info) (format " (%s)" (nth 4 info)) "")) (if (member "none" result-params) (progn (funcall cmd body params) (message "result silenced") (setq result nil)) (setq result (let ((result ...)) (if (and ... ... ...) (list ...) result))) (if (cdr (assoc :file params)) (progn (if result (progn ...)) (setq result (cdr ...)))) (if (cdr (assoc :post params)) (progn (let (...) (setq result ...) (if ... ...)))) (org-babel-insert-result result result-params info new-hash indent lang)) (run-hooks (quote org-babel-after-execute-hook)) result) (setq call-process-region (quote org-babel-call-process-region-original))))
  (cond (cache-current-p (save-excursion (goto-char (org-babel-where-is-src-block-result nil info)) (forward-line) (skip-chars-forward " 	") (let ((result (org-babel-read-result))) (message (replace-regexp-in-string "%" "%%" (format "%S" result))) result))) ((org-babel-confirm-evaluate (let ((i info)) (let* ((c (nthcdr 2 i))) (setcar c merged-params)) i)) (let* ((lang (nth 0 info)) (result-params (cdr (assoc :result-params params))) (body (let* ((c ...)) (setcar c (if ... ... ...)))) (dir (cdr (assoc :dir params))) (default-directory (or (and dir (file-name-as-directory ...)) default-directory)) (org-babel-call-process-region-original (or (and (boundp ...) org-babel-call-process-region-original) (symbol-function (quote call-process-region)))) (indent (nth 5 info)) result cmd) (unwind-protect (let ((call-process-region (function ...))) (let ((lang-check ...)) (setq cmd (or ... ... ...))) (message "executing %s code block%s..." (capitalize lang) (if (nth 4 info) (format " (%s)" ...) "")) (if (member "none" result-params) (progn (funcall cmd body params) (message "result silenced") (setq result nil)) (setq result (let ... ...)) (if (cdr ...) (progn ... ...)) (if (cdr ...) (progn ...)) (org-babel-insert-result result result-params info new-hash indent lang)) (run-hooks (quote org-babel-after-execute-hook)) result) (setq call-process-region (quote org-babel-call-process-region-original))))))
  (let* ((params (if params (org-babel-process-params merged-params) (nth 2 info))) (cachep (and (not arg) (cdr (assoc :cache params)) (string= "yes" (cdr (assoc :cache params))))) (new-hash (if cachep (progn (org-babel-sha1-hash info)))) (old-hash (if cachep (progn (org-babel-current-result-hash)))) (cache-current-p (and (not arg) new-hash (equal new-hash old-hash)))) (cond (cache-current-p (save-excursion (goto-char (org-babel-where-is-src-block-result nil info)) (forward-line) (skip-chars-forward " 	") (let ((result (org-babel-read-result))) (message (replace-regexp-in-string "%" "%%" (format "%S" result))) result))) ((org-babel-confirm-evaluate (let ((i info)) (let* ((c ...)) (setcar c merged-params)) i)) (let* ((lang (nth 0 info)) (result-params (cdr (assoc :result-params params))) (body (let* (...) (setcar c ...))) (dir (cdr (assoc :dir params))) (default-directory (or (and dir ...) default-directory)) (org-babel-call-process-region-original (or (and ... org-babel-call-process-region-original) (symbol-function ...))) (indent (nth 5 info)) result cmd) (unwind-protect (let ((call-process-region ...)) (let (...) (setq cmd ...)) (message "executing %s code block%s..." (capitalize lang) (if ... ... "")) (if (member "none" result-params) (progn ... ... ...) (setq result ...) (if ... ...) (if ... ...) (org-babel-insert-result result result-params info new-hash indent lang)) (run-hooks (quote org-babel-after-execute-hook)) result) (setq call-process-region (quote org-babel-call-process-region-original)))))))
  (progn (let* ((params (if params (org-babel-process-params merged-params) (nth 2 info))) (cachep (and (not arg) (cdr (assoc :cache params)) (string= "yes" (cdr (assoc :cache params))))) (new-hash (if cachep (progn (org-babel-sha1-hash info)))) (old-hash (if cachep (progn (org-babel-current-result-hash)))) (cache-current-p (and (not arg) new-hash (equal new-hash old-hash)))) (cond (cache-current-p (save-excursion (goto-char (org-babel-where-is-src-block-result nil info)) (forward-line) (skip-chars-forward " 	") (let ((result ...)) (message (replace-regexp-in-string "%" "%%" ...)) result))) ((org-babel-confirm-evaluate (let ((i info)) (let* (...) (setcar c merged-params)) i)) (let* ((lang (nth 0 info)) (result-params (cdr ...)) (body (let* ... ...)) (dir (cdr ...)) (default-directory (or ... default-directory)) (org-babel-call-process-region-original (or ... ...)) (indent (nth 5 info)) result cmd) (unwind-protect (let (...) (let ... ...) (message "executing %s code block%s..." ... ...) (if ... ... ... ... ... ...) (run-hooks ...) result) (setq call-process-region (quote org-babel-call-process-region-original))))))))
  (if (org-babel-check-evaluate (let ((i info)) (let* ((c (nthcdr 2 i))) (setcar c merged-params)) i)) (progn (let* ((params (if params (org-babel-process-params merged-params) (nth 2 info))) (cachep (and (not arg) (cdr (assoc :cache params)) (string= "yes" (cdr ...)))) (new-hash (if cachep (progn (org-babel-sha1-hash info)))) (old-hash (if cachep (progn (org-babel-current-result-hash)))) (cache-current-p (and (not arg) new-hash (equal new-hash old-hash)))) (cond (cache-current-p (save-excursion (goto-char (org-babel-where-is-src-block-result nil info)) (forward-line) (skip-chars-forward " 	") (let (...) (message ...) result))) ((org-babel-confirm-evaluate (let (...) (let* ... ...) i)) (let* ((lang ...) (result-params ...) (body ...) (dir ...) (default-directory ...) (org-babel-call-process-region-original ...) (indent ...) result cmd) (unwind-protect (let ... ... ... ... ... result) (setq call-process-region ...))))))))
  (let* ((org-babel-current-src-block-location (or org-babel-current-src-block-location (nth 6 info) (org-babel-where-is-src-block-head) (and (org-babel-get-inline-src-block-matches) (match-beginning 0)))) (info (if info (copy-tree info) (org-babel-get-src-block-info))) (merged-params (org-babel-merge-params (nth 2 info) params))) (if (org-babel-check-evaluate (let ((i info)) (let* ((c (nthcdr 2 i))) (setcar c merged-params)) i)) (progn (let* ((params (if params (org-babel-process-params merged-params) (nth 2 info))) (cachep (and (not arg) (cdr ...) (string= "yes" ...))) (new-hash (if cachep (progn ...))) (old-hash (if cachep (progn ...))) (cache-current-p (and (not arg) new-hash (equal new-hash old-hash)))) (cond (cache-current-p (save-excursion (goto-char ...) (forward-line) (skip-chars-forward " 	") (let ... ... result))) ((org-babel-confirm-evaluate (let ... ... i)) (let* (... ... ... ... ... ... ... result cmd) (unwind-protect ... ...))))))))
  org-babel-execute-src-block(nil)
  (progn (org-babel-eval-wipe-error-buffer) (org-babel-execute-src-block current-prefix-arg) t)
  (if (or (org-babel-where-is-src-block-head) (org-babel-get-inline-src-block-matches)) (progn (org-babel-eval-wipe-error-buffer) (org-babel-execute-src-block current-prefix-arg) t) nil)
  org-babel-execute-src-block-maybe()
  (or (org-babel-execute-src-block-maybe) (org-babel-lob-execute-maybe))
  org-babel-execute-maybe()
  (if org-babel-no-eval-on-ctrl-c-ctrl-c nil (org-babel-execute-maybe))
  org-babel-execute-safely-maybe()
  run-hook-with-args-until-success(org-babel-execute-safely-maybe)
  (cond ((or (and (boundp (quote org-clock-overlays)) org-clock-overlays) org-occur-highlights) (and (boundp (quote org-clock-overlays)) (org-clock-remove-overlays)) (org-remove-occur-highlights) (message "Temporary highlights/overlays removed from current buffer")) ((and (local-variable-p (quote org-finish-function) (current-buffer)) (fboundp org-finish-function)) (funcall org-finish-function)) ((run-hook-with-args-until-success (quote org-ctrl-c-ctrl-c-hook))) (t (if (save-excursion (beginning-of-line) (looking-at "[ 	]*$")) (or (run-hook-with-args-until-success (quote org-ctrl-c-ctrl-c-final-hook)) (user-error "C-c C-c can do nothing useful at this location")) (let* ((context (org-element-context)) (type (org-element-type context))) (cond ((eql type (quote link)) (setq context (org-element-property :parent context)) (setq type (org-element-type context))) ((memql type (quote ...)) (setq context (org-element-lineage context ...)))) (if (eq type (quote paragraph)) (progn (let (...) (if ... ...)))) (cond ((eql type (quote clock)) (org-clock-update-time-maybe)) ((eql type (quote dynamic-block)) (save-excursion (goto-char ...) (org-update-dblock))) ((eql type (quote footnote-definition)) (goto-char (org-element-property :post-affiliated context)) (call-interactively (quote org-footnote-action))) ((eql type (quote footnote-reference)) (call-interactively (quote org-footnote-action))) ((memql type (quote ...)) (save-excursion (goto-char ...) (call-interactively ...))) ((eql type (quote item)) (let* (... ... ... ... ... ...) (org-list-set-checkbox ... struct ...) (org-list-struct-fix-ind struct parents 2) (org-list-struct-fix-item-end struct) (org-list-struct-fix-bul struct prevs) (org-list-struct-fix-ind struct parents) (let ... ... ...))) ((eql type (quote keyword)) (let (... ...) (if ... ...) (let ... ... --rtn)) (message "Local setup has been refreshed")) ((eql type (quote plain-list)) (let* (... ... ... ... ... ...) (cond ... ...) (org-list-write-struct struct ... old-struct) (org-update-checkbox-count-maybe) (save-excursion ... ...))) ((memql type (quote ...)) (call-interactively (quote org-property-action))) ((memql type (quote ...)) (call-interactively (quote org-update-radio-target-regexp))) ((eql type (quote statistics-cookie)) (call-interactively (quote org-update-statistics-cookies))) ((memql type (quote ...)) (if (eq ... ...) (message "Use C-c ' to edit table.el tables") (let ... ...))) ((eql type (quote timestamp)) (org-timestamp-change 0 (quote day))) (t (or (run-hook-with-args-until-success ...) (user-error "C-c C-c can do nothing useful at this location"))))))))
  org-ctrl-c-ctrl-c(nil)

[-- Attachment #3: Type: text/plain, Size: 15 bytes --]


HTH.
-- 
Nick

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

* Re: Scheme code block gives false error message
  2015-09-13  5:41   ` Nick Dokos
@ 2015-09-13 13:14     ` Lawrence Bottorff
  2015-09-13 19:48       ` Nick Dokos
  0 siblings, 1 reply; 18+ messages in thread
From: Lawrence Bottorff @ 2015-09-13 13:14 UTC (permalink / raw)
  To: emacs-orgmode

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

Sorry, Nick, not following you. Could you elaborate more? As a rank
beginner, I'm not sure what a backtrace is or how to produce one or how it
read it. What do you mean by "master" and "maint"?

On Sun, Sep 13, 2015 at 5:41 AM, Nick Dokos <ndokos@gmail.com> wrote:

> Lawrence Bottorff <borgauf@gmail.com> writes:
>
> > Again, this code
> >
> > #+BEGIN_SRC scheme :session ch1 :exports both
> > (define (bool-imply a b)
> >   (if (or (not a) b) #t #f))
> > #+END_SRC
> >
> > gives the error
> >
> > org-babel-scheme-execute-with-geiser: Invalid read syntax: "#"
> >
> > and this time attempting to use the function
> >
> > #+BEGIN_SRC scheme :session ch1 :exports both
> > (bool-imply #t #f)
> > #+END_SRC
> >
> > produces no #RESULTS: block, rather, again, the error (in Messages
> buffer)
> >
> > org-babel-scheme-execute-with-geiser: Invalid read syntax: "#"
> >
> > even though this is perfectly healthy code, and it works in the
> accompanying "ch1" REPL. Any ideas what's happening?
> >
>
> Your previous example worked for me (both with master and maint - I use
> guile, not chicken, but that should make no difference).
>
> But this one fails with the "Invalid read syntax error" and with the
> attached backtrace (running on maint - master gave the same error but
> I didn't get a backtrace).
>
>
>
> HTH.
> --
> Nick
>
>

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

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

* Re: Scheme code block gives false error message
  2015-09-13 13:14     ` Lawrence Bottorff
@ 2015-09-13 19:48       ` Nick Dokos
  2015-09-14  3:50         ` Lawrence Bottorff
  0 siblings, 1 reply; 18+ messages in thread
From: Nick Dokos @ 2015-09-13 19:48 UTC (permalink / raw)
  To: emacs-orgmode

Lawrence Bottorff <borgauf@gmail.com> writes:

> Sorry, Nick, not following you. Could you elaborate more? As a rank
> beginner, I'm not sure what a backtrace is or how to produce one or
> how it read it. What do you mean by "master" and "maint"?
>

It's a debugging aid: it's a dump of the call stack at the time of the
error. It tells you how you got there.

See

  (info "(org) Feedback")

on how to enable it and produce a useful backtrace.

You read it from bottom to top: the bottom-most function has called
the next-to-bottom-most function, ..., which has called the top-most
function, which is in the middle of evaluating some expression when
the error occurred. The section on Debugging in the Emacs Lisp manual
contains more information.

Re: "master" and "maint" - I didn't know which version of org you were
using, so I tried it with both the master branch and the maint branch of
the git tree, as they were yesterday. I should probably have provided
more explicit versions but it was late and I was tired.

For the record, at the time that I was doing that:

"master" was Org-mode version 8.3.1 (release_8.3.1-234-g8c85c9 @
             /home/nick/elisp/org-mode/lisp/)
"maint"  was Org-mode version 8.3.1 (release_8.3.1-120-gbc322f @
             /home/nick/elisp/org-mode/lisp/)

HTH
-- 
Nick

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

* Re: Scheme code block gives false error message
  2015-09-13 19:48       ` Nick Dokos
@ 2015-09-14  3:50         ` Lawrence Bottorff
  2015-09-14 13:39           ` Nick Dokos
  0 siblings, 1 reply; 18+ messages in thread
From: Lawrence Bottorff @ 2015-09-14  3:50 UTC (permalink / raw)
  To: emacs-orgmode

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

I think this (
https://mobiusengineering.wordpress.com/2015/01/11/using-emacs-org-with-mit-scheme/)
describes my problem. Basically, it's with ob-scheme.el. The article seems
to say that my problem is scheme stuff being handled improperly by the
elisp of ob-scheme.el. I'll try his workaround and see if it works. He also
seems to believe Scheme is a second-class citizen in babel-land.

On Sun, Sep 13, 2015 at 7:48 PM, Nick Dokos <ndokos@gmail.com> wrote:

> Lawrence Bottorff <borgauf@gmail.com> writes:
>
> > Sorry, Nick, not following you. Could you elaborate more? As a rank
> > beginner, I'm not sure what a backtrace is or how to produce one or
> > how it read it. What do you mean by "master" and "maint"?
> >
>
> It's a debugging aid: it's a dump of the call stack at the time of the
> error. It tells you how you got there.
>
> See
>
>   (info "(org) Feedback")
>
> on how to enable it and produce a useful backtrace.
>
> You read it from bottom to top: the bottom-most function has called
> the next-to-bottom-most function, ..., which has called the top-most
> function, which is in the middle of evaluating some expression when
> the error occurred. The section on Debugging in the Emacs Lisp manual
> contains more information.
>
> Re: "master" and "maint" - I didn't know which version of org you were
> using, so I tried it with both the master branch and the maint branch of
> the git tree, as they were yesterday. I should probably have provided
> more explicit versions but it was late and I was tired.
>
> For the record, at the time that I was doing that:
>
> "master" was Org-mode version 8.3.1 (release_8.3.1-234-g8c85c9 @
>              /home/nick/elisp/org-mode/lisp/)
> "maint"  was Org-mode version 8.3.1 (release_8.3.1-120-gbc322f @
>              /home/nick/elisp/org-mode/lisp/)
>
> HTH
> --
> Nick
>
>
>

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

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

* Re: Scheme code block gives false error message
  2015-09-14  3:50         ` Lawrence Bottorff
@ 2015-09-14 13:39           ` Nick Dokos
  2015-09-14 15:56             ` Lawrence Bottorff
  2015-09-15  3:10             ` Nick Dokos
  0 siblings, 2 replies; 18+ messages in thread
From: Nick Dokos @ 2015-09-14 13:39 UTC (permalink / raw)
  To: emacs-orgmode

Lawrence Bottorff <borgauf@gmail.com> writes:

> I think this
> (https://mobiusengineering.wordpress.com/2015/01/11/using-emacs-org-with-mit-scheme/)
> describes my problem. Basically, it's with ob-scheme.el. The article
> seems to say that my problem is scheme stuff being handled improperly
> by the elisp of ob-scheme.el.

Yes, that sounds right.

> I'll try his workaround and see if it works. He also seems to believe Scheme is a second-class
> citizen in babel-land.
>

-- 
Nick

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

* Re: Scheme code block gives false error message
  2015-09-14 13:39           ` Nick Dokos
@ 2015-09-14 15:56             ` Lawrence Bottorff
  2015-09-14 18:55               ` Nick Dokos
  2015-09-15  3:10             ` Nick Dokos
  1 sibling, 1 reply; 18+ messages in thread
From: Lawrence Bottorff @ 2015-09-14 15:56 UTC (permalink / raw)
  To: emacs-orgmode

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

So it looks like Scheme is not a Babel language after all. Is there a
formal "bug report" to do?

On Mon, Sep 14, 2015 at 1:39 PM, Nick Dokos <ndokos@gmail.com> wrote:

> Lawrence Bottorff <borgauf@gmail.com> writes:
>
> > I think this
> > (
> https://mobiusengineering.wordpress.com/2015/01/11/using-emacs-org-with-mit-scheme/
> )
> > describes my problem. Basically, it's with ob-scheme.el. The article
> > seems to say that my problem is scheme stuff being handled improperly
> > by the elisp of ob-scheme.el.
>
> Yes, that sounds right.
>
> > I'll try his workaround and see if it works. He also seems to believe
> Scheme is a second-class
> > citizen in babel-land.
> >
>
> --
> Nick
>
>
>

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

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

* Re: Scheme code block gives false error message
  2015-09-14 15:56             ` Lawrence Bottorff
@ 2015-09-14 18:55               ` Nick Dokos
  2015-09-14 21:18                 ` Lawrence Bottorff
  0 siblings, 1 reply; 18+ messages in thread
From: Nick Dokos @ 2015-09-14 18:55 UTC (permalink / raw)
  To: emacs-orgmode

Lawrence Bottorff <borgauf@gmail.com> writes:

> So it looks like Scheme is not a Babel language after all.

What do you mean? There is an ob-scheme.el but it's buggy: I suspect
that every ob-*.el is buggy to some extent. Does that mean that every
language that babel supports is not a babel language?

> Is there a formal "bug report" to do?

Well, whether a formal bug report will help is not clear: it's probably
best that one be submitted if only for documentation purposes, but
whether it will be addressed or not very much depends on somebody
picking it up and fixing it. You might be able to persuade "Möbius"
to sign FSF papers and submit his implementation (but note that there
are limitations there, as mentioned on the page you linked - so there
will be bugs...)

>
> On Mon, Sep 14, 2015 at 1:39 PM, Nick Dokos <ndokos@gmail.com> wrote:
>
>     Lawrence Bottorff <borgauf@gmail.com> writes:
>    
>     > I think this
>     > (https://mobiusengineering.wordpress.com/2015/01/11/using-emacs-org-with-mit-scheme/)
>     > describes my problem. Basically, it's with ob-scheme.el. The article
>     > seems to say that my problem is scheme stuff being handled improperly
>     > by the elisp of ob-scheme.el.
>    
>     Yes, that sounds right.
>    
>     > I'll try his workaround and see if it works. He also seems to believe Scheme is a second-class
>     > citizen in babel-land.
>     >
>    
>     --
>     Nick

-- 
Nick

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

* Re: Scheme code block gives false error message
  2015-09-14 18:55               ` Nick Dokos
@ 2015-09-14 21:18                 ` Lawrence Bottorff
  2015-09-15  1:38                   ` Nick Dokos
  0 siblings, 1 reply; 18+ messages in thread
From: Lawrence Bottorff @ 2015-09-14 21:18 UTC (permalink / raw)
  To: Nick Dokos; +Cc: emacs-orgmode

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

On Mon, Sep 14, 2015 at 6:55 PM, Nick Dokos <ndokos@gmail.com> wrote:


> > So it looks like Scheme is not a Babel language after all.
>
> What do you mean? There is an ob-scheme.el but it's buggy: I suspect
> that every ob-*.el is buggy to some extent. Does that mean that every
> language that babel supports is not a babel language?
>

I only mean it can't be used as it now is. I was only three simple example
code snippets into this when it proved inoperable. I wanted to use it as a
study aid for HTDP or SICP or one of the other Scheme tutorials . . . as in
make some personal comments around code samples.


>
> > Is there a formal "bug report" to do?
>
> Well, whether a formal bug report will help is not clear: it's probably
> best that one be submitted if only for documentation purposes, but
> whether it will be addressed or not very much depends on somebody
> picking it up and fixing it. You might be able to persuade "Möbius"
> to sign FSF papers and submit his implementation (but note that there
> are limitations there, as mentioned on the page you linked - so there
> will be bugs...)
>
> I keep putting off learning elisp. Maybe this is the "Schub" I need. You
know, stop being such a needy org-mode tourist and start being a local. :-)

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

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

* Re: Scheme code block gives false error message
  2015-09-14 21:18                 ` Lawrence Bottorff
@ 2015-09-15  1:38                   ` Nick Dokos
  0 siblings, 0 replies; 18+ messages in thread
From: Nick Dokos @ 2015-09-15  1:38 UTC (permalink / raw)
  To: emacs-orgmode

Lawrence Bottorff <borgauf@gmail.com> writes:

> On Mon, Sep 14, 2015 at 6:55 PM, Nick Dokos <ndokos@gmail.com> wrote:
>  
>
>     > So it looks like Scheme is not a Babel language after all.
>    
>     What do you mean? There is an ob-scheme.el but it's buggy: I suspect
>     that every ob-*.el is buggy to some extent. Does that mean that every
>     language that babel supports is not a babel language?
>
> I only mean it can't be used as it now is. I was only three simple
> example code snippets into this when it proved inoperable. I wanted to
> use it as a study aid for HTDP or SICP or one of the other Scheme
> tutorials . . . as in make some personal comments around code
> samples.  
>
>     > Is there a formal "bug report" to do?
>    
>     Well, whether a formal bug report will help is not clear: it's probably
>     best that one be submitted if only for documentation purposes, but
>     whether it will be addressed or not very much depends on somebody
>     picking it up and fixing it. You might be able to persuade "Möbius"
>     to sign FSF papers and submit his implementation (but note that there
>     are limitations there, as mentioned on the page you linked - so there
>     will be bugs...)
>
> I keep putting off learning elisp. Maybe this is the "Schub" I
> need. You know, stop being such a needy org-mode tourist and start
> being a local. :-)
>

That would be ideal :-)

Did you try the alternative ob-scheme.el? If (when) you do, maybe you can post
some comments: would it be worth to pursue replacing the current one
with the alternative?

-- 
Nick

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

* Re: Scheme code block gives false error message
  2015-09-14 13:39           ` Nick Dokos
  2015-09-14 15:56             ` Lawrence Bottorff
@ 2015-09-15  3:10             ` Nick Dokos
  2015-09-15  4:41               ` Nick Dokos
  1 sibling, 1 reply; 18+ messages in thread
From: Nick Dokos @ 2015-09-15  3:10 UTC (permalink / raw)
  To: emacs-orgmode

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

Nick Dokos <ndokos@gmail.com> writes:

> Lawrence Bottorff <borgauf@gmail.com> writes:
>
>> I think this
>> (https://mobiusengineering.wordpress.com/2015/01/11/using-emacs-org-with-mit-scheme/)
>> describes my problem. Basically, it's with ob-scheme.el. The article
>> seems to say that my problem is scheme stuff being handled improperly
>> by the elisp of ob-scheme.el.
>
> Yes, that sounds right.
>
>> I'll try his workaround and see if it works. He also seems to believe Scheme is a second-class
>> citizen in babel-land.
>>

Actually... I don't know why that (read result) is there at all: result
is a string representation of the result that the scheme interpreter
returned. It does not make any sense to me that we try to read that and
make it into an elisp object: we should just return the string itself.

With that change (see attached patch) on more-or-less current master
(the exact version is Org-mode version 8.3.1 (release_8.3.1-236-g14f5f6
@ /home/nick/src/emacs/org/org-mode/lisp/), I can evaluate everything
that you sent out without any error (see attached file "scheme.org"
which includes evaluation results).

N.B. this is with guile: I have not tried chicken, MIT Scheme or any
other scheme implementation.

Thoughts?

-- 
Nick


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: [PATCH-RFC] org-babel-scheme-execute-with-geiser fix --]
[-- Type: text/x-patch, Size: 736 bytes --]

From 14f5f6312f77b0252f4d29609f996af42c78a938 Mon Sep 17 00:00:00 2001
From: Nick Dokos <ndokos@gmail.com>
Date: Mon, 14 Sep 2015 22:51:26 -0400
Subject: [PATCH] Return result, not (read result) from
 org-babel-scheme-execute-with-geiser

---
 lisp/ob-scheme.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/ob-scheme.el b/lisp/ob-scheme.el
index b10dfc3..c8f7f5e 100644
--- a/lisp/ob-scheme.el
+++ b/lisp/ob-scheme.el
@@ -172,7 +172,7 @@ is true; otherwise returns the last value."
 	(setq result (if (or (string= result "#<void>")
 			     (string= result "#<unspecified>"))
 			 nil
-		       (read result)))))
+		       result))))
     result))
 
 (defun org-babel-execute:scheme (body params)
-- 
2.4.3


[-- Attachment #3: scheme.org - scheme examples from Lawrence Bottorff --]
[-- Type: text/plain, Size: 814 bytes --]

#+BEGIN_SRC scheme :session ch1 :exports both
  (define (check-it x)
   (cond
    ((string? x) (string-length x))
    ((number? x) (if (<= x 0) x (- x 1)))
    ((boolean? x) (if (and #t x) 10 20))
    (else #f)))

#+END_SRC

#+RESULTS:


#+BEGIN_SRC scheme :session ch1
(define (square x)
 (* x x))

#+END_SRC

#+RESULTS:

#+BEGIN_SRC scheme :session ch1
(check-it "Foobar")
#+END_SRC

#+RESULTS:
: 6

#+BEGIN_SRC scheme :session ch1
(square 5)
#+END_SRC

#+RESULTS:
: 25

#+BEGIN_SRC scheme :session ch1 :exports both
(define (bool-imply a b)
 (if (or (not a) b) #t #f))
#+END_SRC

#+RESULTS:

#+BEGIN_SRC scheme :session ch1 :exports both
(bool-imply #t #f)
#+END_SRC

#+RESULTS:
: #f

#+BEGIN_SRC scheme :session ch1 :exports both
map
#+END_SRC

#+RESULTS:
: #<procedure map (f l) | (f l1 l2) | (f l1 . rest)>


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

* Re: Scheme code block gives false error message
  2015-09-15  3:10             ` Nick Dokos
@ 2015-09-15  4:41               ` Nick Dokos
  2015-09-15  4:48                 ` Nick Dokos
  0 siblings, 1 reply; 18+ messages in thread
From: Nick Dokos @ 2015-09-15  4:41 UTC (permalink / raw)
  To: emacs-orgmode

Nick Dokos <ndokos@gmail.com> writes:

> N.B. this is with guile: I have not tried chicken, MIT Scheme or any
> other scheme implementation.
>

A comment on SO says that geiser (which is used by ob-scheme)
only supports guile and racket, so until that changes, chicken or MIT
Scheme won't work:

http://stackoverflow.com/questions/26578152/use-mit-scheme-instead-of-guile-for-org-mode-code-block-evaluation

-- 
Nick

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

* Re: Scheme code block gives false error message
  2015-09-15  4:41               ` Nick Dokos
@ 2015-09-15  4:48                 ` Nick Dokos
  2015-09-15 17:08                   ` Lawrence Bottorff
  0 siblings, 1 reply; 18+ messages in thread
From: Nick Dokos @ 2015-09-15  4:48 UTC (permalink / raw)
  To: emacs-orgmode

Nick Dokos <ndokos@gmail.com> writes:

> Nick Dokos <ndokos@gmail.com> writes:
>
>> N.B. this is with guile: I have not tried chicken, MIT Scheme or any
>> other scheme implementation.
>>
>
> A comment on SO says that geiser (which is used by ob-scheme)
> only supports guile and racket, so until that changes, chicken or MIT
> Scheme won't work:
>
> http://stackoverflow.com/questions/26578152/use-mit-scheme-instead-of-guile-for-org-mode-code-block-evaluation

Eh, I should have checked the geiser site: it says


    Racket 6.0 or better
    Guile 2.0.9 or better
    Chicken 4.8.0 or better

are supported and there is work afoot to support scsh - no mention of
MIT Scheme afaict.

-- 
Nick

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

* Re: Scheme code block gives false error message
  2015-09-15  4:48                 ` Nick Dokos
@ 2015-09-15 17:08                   ` Lawrence Bottorff
  2015-09-15 17:25                     ` Lawrence Bottorff
  0 siblings, 1 reply; 18+ messages in thread
From: Lawrence Bottorff @ 2015-09-15 17:08 UTC (permalink / raw)
  To: emacs-orgmode

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

I've tried the Moebius workaround (see above). It seems to work, and

#+begin_src scheme
. . .

seems to call my MIT scheme and do results just fine. But it ignores the
idea of multiple sessions, which the geiser-based ob-scheme did so well and
just has one MIT scheme "session." However it does not start a normal
scheme REPL, rather, a "scratch"-like buffer that, in fact, seems to have
MIT scheme listening to it. That is, I can type in

(define (me x)
  (* x x x x))

and with C-x C-e everything is working, just like scratch and elisp do.

Will try to use your patch and get back to you

On Tue, Sep 15, 2015 at 12:48 AM, Nick Dokos <ndokos@gmail.com> wrote:

> Nick Dokos <ndokos@gmail.com> writes:
>
> > Nick Dokos <ndokos@gmail.com> writes:
> >
> >> N.B. this is with guile: I have not tried chicken, MIT Scheme or any
> >> other scheme implementation.
> >>
> >
> > A comment on SO says that geiser (which is used by ob-scheme)
> > only supports guile and racket, so until that changes, chicken or MIT
> > Scheme won't work:
> >
> >
> http://stackoverflow.com/questions/26578152/use-mit-scheme-instead-of-guile-for-org-mode-code-block-evaluation
>
> Eh, I should have checked the geiser site: it says
>
>
>     Racket 6.0 or better
>     Guile 2.0.9 or better
>     Chicken 4.8.0 or better
>
> are supported and there is work afoot to support scsh - no mention of
> MIT Scheme afaict.
>
> --
> Nick
>
>
>

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

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

* Re: Scheme code block gives false error message
  2015-09-15 17:08                   ` Lawrence Bottorff
@ 2015-09-15 17:25                     ` Lawrence Bottorff
  2015-09-15 18:54                       ` Lawrence Bottorff
  2015-09-15 19:14                       ` Nick Dokos
  0 siblings, 2 replies; 18+ messages in thread
From: Lawrence Bottorff @ 2015-09-15 17:25 UTC (permalink / raw)
  To: emacs-orgmode

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

. . . quick question, Nick (et al): how do I (enlightened beginner) apply
the above patch? I'm using latest ELPA from org-mode repo.

LB

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

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

* Re: Scheme code block gives false error message
  2015-09-15 17:25                     ` Lawrence Bottorff
@ 2015-09-15 18:54                       ` Lawrence Bottorff
  2015-09-15 19:14                       ` Nick Dokos
  1 sibling, 0 replies; 18+ messages in thread
From: Lawrence Bottorff @ 2015-09-15 18:54 UTC (permalink / raw)
  To: emacs-orgmode

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

Ach, disregard that last bleating. Got it changed, and yes, it works -- for
both guile and chicken. Thanks a ton, ND.

But, yes, if there's a cool emacs way to take your diff and apply it I'd
like to know. . .

LB

On Tue, Sep 15, 2015 at 5:25 PM, Lawrence Bottorff <borgauf@gmail.com>
wrote:

> . . . quick question, Nick (et al): how do I (enlightened beginner) apply
> the above patch? I'm using latest ELPA from org-mode repo.
>
> LB
>
>
>

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

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

* Re: Scheme code block gives false error message
  2015-09-15 17:25                     ` Lawrence Bottorff
  2015-09-15 18:54                       ` Lawrence Bottorff
@ 2015-09-15 19:14                       ` Nick Dokos
  1 sibling, 0 replies; 18+ messages in thread
From: Nick Dokos @ 2015-09-15 19:14 UTC (permalink / raw)
  To: emacs-orgmode

Lawrence Bottorff <borgauf@gmail.com> writes:

> . . . quick question, Nick (et al): how do I (enlightened beginner) apply the above patch? I'm using
> latest ELPA from org-mode repo.
>

Save the patch in a file (say "ob-scheme.patch") in the top level
directory of your org-mode tree (the one that includes the lisp/
subdirectory), cd to that directory and (assuming you have the "patch"
executable on your system), say

 patch -p 1 < ob-scheme.patch

Alternatively, just edit .../lisp/ob-scheme.el, find the line that says

 (read result)))))

(line 175 in my version) and replace the "(read result)" with just
"result" - leave the rest of the parens alone.

Nick

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

end of thread, other threads:[~2015-09-15 19:14 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-12  1:23 Scheme code block gives false error message Lawrence Bottorff
2015-09-13  4:03 ` Lawrence Bottorff
2015-09-13  5:41   ` Nick Dokos
2015-09-13 13:14     ` Lawrence Bottorff
2015-09-13 19:48       ` Nick Dokos
2015-09-14  3:50         ` Lawrence Bottorff
2015-09-14 13:39           ` Nick Dokos
2015-09-14 15:56             ` Lawrence Bottorff
2015-09-14 18:55               ` Nick Dokos
2015-09-14 21:18                 ` Lawrence Bottorff
2015-09-15  1:38                   ` Nick Dokos
2015-09-15  3:10             ` Nick Dokos
2015-09-15  4:41               ` Nick Dokos
2015-09-15  4:48                 ` Nick Dokos
2015-09-15 17:08                   ` Lawrence Bottorff
2015-09-15 17:25                     ` Lawrence Bottorff
2015-09-15 18:54                       ` Lawrence Bottorff
2015-09-15 19:14                       ` 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).