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

Re: current-dateTime()

Subject: Re: current-dateTime()
From: David Carlisle <davidc@xxxxxxxxx>
Date: Fri, 18 Apr 2008 13:06:59 +0100
Re:  current-dateTime()
> What is the reasoning behind defining as current-dateTime() and
> current-time() as being "current at some time during the evaluation of
> a query or transformation"?

I'm not on the WG, but this is consistent with saying that doc() and
document() etc return the same result if called twice in a transform.

Non-pure functions (even though you may end up  allowing them somewhere)
really mess up the model of a declarative functional programming
language.

In a purely declarative system it's completely safe to pull out common
code, and save values in internal variables, or conversely to not
pre-compute the value of a variable but rather inline it and evaluate
the expression (or relevant parts of the expression) wheneevr a variable
is used. It should be safe to rewrite f() - f() to zero, but if f() is
running the current time and the intention is to return teh elapsed
time, then the system needs to evaluate the function twice, and evaluate
the expressions in the required chronological order (whereas normally it
can evaluate anything in any rder, so long as it assembles the results
in the right way).

If you want to look at how a clean(ish) model disolves once you add
expressions that assume a particular execution order have a look at the
xquery scripting extension drafts:-)

XSLT2 has non pure functios anyway, as any function that generates a
new element node has these problems as each call will generate nodes
with distinct identies, even if called with the same arguments, so you
may have to allow some non pure functions somehow, but it should be
avoided if possible.




David

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

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.
Email
First Name
Last Name
Company
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.