GnuCash reports via eguile - probably not

Derek Atkins warlord at MIT.EDU
Wed Jan 21 13:28:16 EST 2009


Quoting Derek Atkins <warlord at MIT.EDU>:
[snip]
>> Can any Guile/Scheme experts help?

I found some help, and here's some working code:

;#! /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 "(begin (display bar) (newline) (display fred) (newline)
(display bar) (newline))"))
     (with-input-from-string string1 (lambda () (local-eval (read)
(the-environment))))
     ))
(foo "Actual parameter")


Note that I added the 'begin' because the 'read' will only read in one
s-expression.  You could theoretically read in multiple s-expressions
in a loop if you wanted.  But this was easier.

This code works for me.

-derek


-- 
       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
       warlord at MIT.EDU                        PGP key available



More information about the gnucash-devel mailing list