guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: evaluating a file with out side effects


From: Arno Peters
Subject: Re: evaluating a file with out side effects
Date: Mon, 2 Jun 2003 22:45:37 +0200
User-agent: Mutt/1.5.4i

On Sun, Jun 01, 2003 at 08:25:26PM -0400, Thomas Mulcahy wrote:
> Hi, I'm attempting to use scheme to generate HTML for
> a page like this:
> http://okmij.org/ftp/Scheme/xml.scm
> (See http://okmij.org/ftp/Scheme/xml.html for the HTML
> version).

> To do this, I need to evaluate the contents of a file
> and get the result. The guile load procedure returns
> unspecified however, instead of the result of
> evaluating the file. I can see how it would be
> possible to evaluate each s-expression in the file but
> this seems a bit awkward and would have side effects
> (definitions in the file might overwrite my own
> definitions). What is the best way to do this?

SSAX uses the function SRV:send-reply to display the list of
fragments.  At the end of xml.scm, you see:

  (define (generate-HTML Content)
   (SRV:send-reply
    (pre-post-order Content
     (generic-web-rules Content '()))))
  
  (generate-HTML Content)

Note that the variable Content in the last line contains the SXML
expressions that are to be transformed into HTML.  Perhaps these lines
are missing from your file?

You may run into some problems using SSAX with Guile directly from the
CVS repository. I use the two attached files to integrate SSAX into
Guile.  Use these files if you like to get SSAX to work for you, they
are hereby released into the public domain.

Regards,
-- 
Arno Peters


Attachment: myenv-guile.scm
Description: Text document

Attachment: sxml.scm
Description: Text document

Attachment: pgpSEHXdTRK1w.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]