Hi Liam,
Hmm, what if there's a $factorial in scope already? (this is a
technique i teach for taking advantage of closures to hide data)
Variables that are declared more than once in XQuery will continue to be rejected with the error code XQST0049 (duplicate declaration of static variable):
declare variable $a := 123; declare variable $a := 'whatever';
Best, Christian