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

Re: Sequential numbers in pure xslt, breaking the no-

Subject: Re: Sequential numbers in pure xslt, breaking the no-side-effect rule
From: Abel Braaksma <abel.online@xxxxxxxxx>
Date: Fri, 16 Mar 2007 17:42:48 +0100
Re:  Sequential numbers in pure xslt
David Carlisle wrote:
I don't have that luxury,

Sometimes (like here) it's tempting (or even from a performance point of
view perhaps a requirement) to say you need an imperative assignment
with side effects and guaranteed execution order, but in a strong sense
that is not true. That's Turing's (standing on Church and Godel and
others) main insight: Any machine (or programming language) that can
compute anything intersting at all can compute exactly the same
algorithms as every other one. So no algorithm _requires_ state to be
mantained as a side effect, it's _always_ possible to rewrite the
algorithm so that any state required is explictly passed from function
to function.

Nice to see Turing coming along here. You have a clear point and you are right, of course. I just don't often look at the language in such a way.


Now it may be that in practical cases the amount of state
that would be required to be passed is large and you don't want to pass
it through a function call interface, but well, that's the job of the
optimising complier to sort out.  Saying that the _end user_ has to
rewrite the algorithm in an imperative style in order to get an
effective computation is just so 1960's:-)

and man, do I love the sixties!


But what I really meant was: if you have some function library, it's just easier to have something like "get-uuid()", instead of "get-uuid(get-uuid(get-uuid()))". But I understand (I think) your point in how it can be done with functional programming. I've just lingered too long in the imperative world and sometimes I just can't resist to try to bridge the two.

Thanks for your insights,

Cheers,
-- Abel

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.