Skip to content

Instantly share code, notes, and snippets.

@derickson derickson/bad.xqy
Created May 4, 2012

Embed
What would you like to do?
Learning XQuery 2
(: I assume local mathematical functions
functionA, functionB, and functionC are
defined above :)
(: this is too procedural :)
let $accumulator := 1
let $accumulator := functionA($accumulator)
let $accumulator := functionB($accumulator)
let $accumulator := functionC($accumulator)
return
$accumulator
(: now you're thinking with functions :)
functionC( functionB( functionA( 1 )))
(: maybe more maintainable,
especially when IF and FLWOR statements
get mixed in :)
functionC (
functionB (
functionA (
1
)
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.