side-effect-free (was Re: Can solve the N-queens - but can't count!)

Subject: side-effect-free (was Re: Can solve the N-queens - but can't count!)
From: "James Tauber" <jtauber@xxxxxxxxxxx>
Date: Thu, 17 Jun 1999 15:46:40 +0800
>I think it would be useful to the debate if someone could articulate the
>reasons why stylesheets should be side-effect-free.

I won't claim to fully understand the implications of a stylesheet language
being side-effect-free, but a property that occurred to me this morning
while working on a little tool to help document XSL stylesheets was the
following...

Consider a template:

<xsl:template match="A">
    <xsl:apply-templates select="B"/>
    <xsl:apply-templates select="C"/>
</xsl:template>

As I understand, the side-effect-freeness of XSL means that when processing
this above template, you can go and apply the template for C before the
template for B, or run both in parallel, etc without having to worry that
something that applying one template does will affect the application of the
other.

JamesT


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread