[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[O] BUG in ob-scheme WAS: Re: Babel: verbatim results yield a table
From: |
Berry, Charles |
Subject: |
[O] BUG in ob-scheme WAS: Re: Babel: verbatim results yield a table |
Date: |
Thu, 2 Aug 2018 17:08:36 +0000 |
> On Aug 2, 2018, at 5:19 AM, Jarmo Hurri <address@hidden> wrote:
>
>
> Greetings.
>
> The org manual states that in the :results header argument of a block
>
> verbatim Interpret literally and insert as quoted text. Do not create a
> table. Usage example: :results value verbatim
Unfortunately, `org-babel-scheme--table-or-string' does not honor :results
verbatim. :-(
>
> The quote above is from https://orgmode.org/manual/results.html
>
> Given this description, I am trying to understand the result below from
> a Scheme snippet (this is an exercise in the good old SICP). In
> particular, why is the table created from the (nested) list?
>
> Jarmo
>
> #+BEGIN_SRC scheme :exports both :results value verbatim
> (define (deep-reverse lst)
> (define (deep-iter lst result)
> (if (null? lst)
> result
> (let ((first (car lst)) (rest (cdr lst)))
> (deep-iter rest
> (cons (if
> (pair? first)
> (deep-reverse first)
> first)
> result)))))
> (deep-iter lst '()))
>
> (deep-reverse (list (list 1 2 3 4) (list (list 5 6) 7 8)))
> #+END_SRC
>
> #+RESULTS:
> | 8 | 7 | (6 5) | |
> | 4 | 3 | 2 | 1 |
>
HTH,
Chuck