programming gnucash in scheme
Josh Sled
jsled@asynchronous.org
Sat, 23 Jun 2001 02:47:59 -0700
On Thu, Jun 21, 2001 at 01:46:12PM -0400, Jonathan A Rees wrote:
| I'm having a difficult time getting started programming gnucash in
| Scheme (Guile). I found
| http://gnucash.org/lxr/gnucash/source/doc/guile-hackers.txt
| but it doesn't really tell me enough.
One of the best texts on Scheme [and computer programming in general] is
"Structure and Interpretation of Computer Programs", by Ableson, Sussman
and Sussman... this is the text for intro CS at both MIT and Berkeley [and
certainly other unis]... niftily-enough, it's available on the web nowadays:
http://mitpress.mit.edu/sicp/full-text/book/book.html
The archives should have other pointers on useful sites/texts.
| 1. How do I start a Guile read-eval-print loop that's connected to
| gnucash? What's the best way to load Guile code into gnucash?
I'm not a gnucash-guile-guru [G^{3}? :)], but I'll explain what I know...
First, there's a "--eval" switch to gnucash [at least in 1.6.0] which
will let you eval single scheme statements; I believe this exists in
earlier versions as well.
I also see "--load", which *ahem* "Load[s] the given .scm file" [from
src/scm/command-line.scm], which you might want to check out.
| 2. What are the gnucash-related procedures I get to use from Scheme?
| The "constructing custom reports" page of the 1.4.9 documentation
| refers to a source file src/g-wrap/gnc.html, which I am unable to find
| in the online source tree at gnucash.org.
Well, first off, I'd really start with the 1.6.0 codebase... it's
a) current and b) improved. :)
There are two classes of things you can access from Gnucash's scheme:
. scheme-defined functions [src/scm/*]
. g-wrapped functions, which you can find in src/guile/gnc.gwp, which
defines the wrappers around the c-defined functions.
And, indeed, the reporting stuff is a good place to look... especially
the current [1.6.0/CVS] reporting stuff.
| I'm interested in accessing the engine -- the GUI stuff doesn't
| interest me (yet).
Well, I my experience is C-focused, but I've seen that when the register
goes to save a tranaction you've modified, it does so in a scheme
procedure... so there's certainly at least some[, and I'd venture to say
"complete",] access to the engine...
Cheers...
...jsled