GnuCash reports via eguile - probably not

Arthur Ralfs arthur at mathbrane.ca
Wed Jan 21 14:15:00 EST 2009


Chris Dennis wrote:
> I've boiled the problem down to this:
>
> ----
> ;#! /usr/bin/guile
> (define fred "This is Fred")
> (define (foo bar)
>    (display fred) (newline) (display bar) (newline)
>    (display "and now via eval-string...") (newline)
>    (let ((string1 "(display fred) (newline) (display bar) (newline)"))
>      (eval-string string1)))
> (foo "Actual parameter")
> ----
> gives this output:
> ----
> This is Fred
> Actual parameter
> and now via eval-string...
> This is Fred
> ERROR: Unbound variable: bar
> ----
>   
Here's another approach:

(define fred "This is Fred")
(define (foo bar)
    (display fred) (newline) (display bar) (newline)
    (display "and now via eval-string...") (newline)
    (let ((string1 (string-append "(display fred) (newline) (display \""
bar "\") (newline)")))
      (eval-string string1)))
(foo "Actual parameter")


Arthur


More information about the gnucash-devel mailing list