[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Re: Incrementing a Global variable

Subject: RE: Re: Incrementing a Global variable
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Thu, 28 Aug 2003 15:40:31 +0100
RE:  Re: Incrementing a Global variable
> If you have a function f(x) and and expression
> f(x) + f(x)
> it may be optimised to 2 * f(x) which means you only have to 
> calculate the function once.
> However you can't do that if there is a possibility of the 
> "function" doing something strange like incrementing teh 
> value of some second variable y as in the first case y goes 
> up by 2 and in the second it goes up by 1.

Unfortunately when it's

   f(x) is f(x)

then you do have to evaluate the function twice; expressions in XPath
2.0 are allowed to have the limited side-effect of creating new,
distinct nodes. 

The formal semanticists seem happy that this is under control, but I
can't say I've worked out all the implications for my optimizer yet!

Michael Kay

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

Current Thread


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.