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

Re: Scope of variables

Subject: Re: Scope of variables
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Fri, 09 May 2003 13:11:21 -0400
Re:  Scope of variables
At 04:46 AM 5/9/2003, David C wrote:
When I first was shown programming (Fortran at school in the mid 70's)
this aspect of fortran allowing variables to change their definition
was the main "strange" thing about programming languages that all the
books stressed. that programming languages had these strange imperative
features because they were designed to be easily executed by machines
rather than easily understood by humans.

A generation later and things have changed: machines are now more
powerful and so programming languages using more natural declarative
constructs are now feasible. Let the machine do the work and have the
language more suitable for humans. But things are not so simple, it
seems that in the intervening time humans have got used to the
imperative machine-oriented languages and are now unsettled by human
oriented declarative languages. You can't win....

As a footnote to what David says, as a "human-oriented declarative language" XSLT seems to work best (partly; and I say "seem" because (a) this is actually a bit complicated, and (b) I just use these machines I don't build them) when you let it *manage for you* the processing logic of the operation (by letting it execute, where possible, a tree traversal). These are "templates", not "subroutines", and variables are mainly used to hold values that you may want and need, not control the process flow. Not long ago on this list I suggested an XSLT transform needs to be seen as an *output specification*, not a process. (At which someone helpfully mentioned the functional view: you are designing a function in terms of outputs for given inputs, and shouldn't have to worry about how the machine goes about executing it.)


It takes a real shift in mind set, especially when you run into problems for which XSLT *doesn't* give you direct support, and you find yourself implementing loops by recursion, etc. Not that that can't be done -- it can, and has been.

Cheers,
Wendell


___&&__&_&___&_&__&&&__&_&__&__&&____&&_&___&__&_&&_____&__&__&&_____&_&&_ "Thus I make my own use of the telegraph, without consulting the directors, like the sparrows, which I perceive use it extensively for a perch." -- Thoreau


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



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.