[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Is xsl:for-each "syntactic sugar"?
On 07/05/2010 07:27, Markus Karg wrote:
1. Everything that can be done using xsl:for-each can be done using a recursive function. (True or False) It's true enough for quarter to three in the morning while watching xsl-list with half an eye and the UK election results with the other half (and being asleep with the rest) the stack size limiting the number of recursions is much more limited than the width of your CPU limiting the number of iterations. How much stack size gets used up is in large part a function of the compiler, although chances are that in practice you are right and that the recursive form will use more. > So you can do much more loops than iterations. > Also, xsl:for-each can (in theory) beAlso, xsl:for-each is much easier to understand than a potentially complex recursive function (you SEE that it is a loop, while you have NOTICE that it is recursive). implemented using parallel execution (multiple cores) while recursion necessarily must be a single core as it is up to the coder where / when in his particular algorithm the recursive call takes place. the rest is more or less agreeing with the answer I gave to point 4, which you didn't quote, that despite any theoretical equivalence between the forms a real compiler is going to have an easier job with the specific construct rather than trying to spot efficient idioms using more general programming forms. David ________________________________________________________________________ The Numerical Algorithms Group Ltd is a company registered in England and Wales with company number 1249803. The registered office is: Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom. This e-mail has been scanned for all viruses by Star. The service is powered by MessageLabs. ________________________________________________________________________
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|