Re: [xsl] RE: Is xsl:for-each "syntactic sugar"?

Subject: Re: [xsl] RE: Is xsl:for-each "syntactic sugar"?
From: David Carlisle <davidc@xxxxxxxxx>
Date: Fri, 07 May 2010 21:55:20 +0100
On 07/05/2010 17:42, Costello, Roger L. wrote:
In the book, Structure and Interpretation of Computer Programs by Abelson, Sussman, and Sussman, the authors assert that looping constructs (such as xsl:for-each) are syntactic sugar:

but they didn't add the parenthetical comment "(such as xsl:for-each)" that you have added.

Scheme mandates that systems implement tail recursion elimination, and define the behaviour of the specific looping constructs in terms of a tail recursive call, thus the different syntaxes are, by definition, in scheme, equivalent. So one syntax may be considered as syntactic sugar for the other.

XSLT doesn't mandate systems implement tail recursion elimination, and doesn't mandate any execution order on the items in a for-each, so the situation in xslt is not comparable to scheme.

David

Current Thread