On Wed, 2024-09-18 at 13:08 +0200, Christian Grün wrote: > > In addition, XQuery 4 will allow all of us to write self-referencing > variable declarations (it’s already supported by the latest > snapshot): > > declare variable $factorial := fn($x) { > if($x > 1) then $x + $factorial($x - 1) else $x > }; > $factorial(5)
Hmm, what if there's a $factorial in scope already? (this is a technique i teach for taking advantage of closures to hide data) > > -- Liam Quin, https://www.delightfulcomputing.com/ Available for XML/Document/Information Architecture/XSLT/ XSL/XQuery/Web/Text Processing/A11Y training, work & consulting. Barefoot Web-slave, antique illustrations: http://www.fromoldbooks.org