[plt-scheme] Re: sxml.ss - Works on its own, but not in module

From: Dmitry Lizorkin (lizorkin at ispras.ru)
Date: Thu Jan 17 03:56:15 EST 2008

Hello!

> However, I  would be very surprised if it wasn't possible to rewrite the 
> code so  that
> a) it didn't use eval,

Eval is used in stx-engine for providing support for Scheme extensions in 
XSLT stylesheets. Scheme extensions are provided via special <stx:eval> and 
<stx:template> template elements; Kirill Lisovsky, the stx-engine author, 
described them in STX Position Paper
http://www196.pair.com/lisovsky/download/misc/stx.ps.gz
subsections 6.3.1 and 6.3.2.

On the other hand, eval is used in stx-engine code for uniformly 
interpreting both pure XSLT templates and Scheme extension templates. The 
latter design decision taken results in eval to be required for interpreting 
even pure XSLT stylesheets with no Scheme extensions embedded into them.

About a year ago, I discussed this eval over-usage issue with Kirill. Our 
idea was to separate pure XSLT constructs interpretation from Scheme 
extensions interpretation to make the former independent of eval. Although 
this idea does not eliminate eval from stx-engine completely, it eliminates 
the need for applying eval for an important practical stylesheets subset - 
pure XSLT stylesheets with no Scheme extensions embedded in them.

However, this idea has not been implemented in stx-engine yet.

>  (define-namespace-anchor bar-world)
>  (define (bar:g) (eval '(bar:f) (namespace-anchor->namespace bar-world)))

Thank you for the solution! I'll investigate this technique.

Dmitry



Posted on the users mailing list.