|
[XQuery Talk Mailing List Archive Home] [By Date] [By Thread] [By Subject] [By Author] [Recent Entries] [Reply To This Message] Global variables in XQueryLiam Quin liam at w3.orgWed Oct 4 12:40:03 PDT 2006
On Wed, Oct 04, 2006 at 05:24:58PM +0200, Massimo Franceschet wrote: > I am confused about the behaviour of (what are called) global variables in > XQuery. XQuery is a declarative functional language, and doesn't let you change the value of a variable. If you define my:global at the top level, and then in a function define a variable called my:global, with let $my:global := $my:global + 1 now you have two variables called my:global until the end of the enclosing statement, when the new one will go out of scope and the old one will be visible again. The "let" part of a FLWOR always creates new variables. Think of them as named constants if you prefer... Liam -- Liam Quin, W3C XML Activity Lead, http://www.w3.org/People/Quin/ http://www.holoweb.net/~liam/ * http://www.fromoldbooks.org/
|
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
|






