Subject: Re: [xsl] Issues with xs:error in the XPath 3.0 and XDM 3.0 Recommendations.|
From: Michael Sokolov <msokolov@xxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 20 Apr 2014 13:36:23 -0400
Functions that are declared as returning empty-sequence() are most likely operating via side-effect; I would think this would be a pretty good indicator to an optimizer that it is not safe to remove calls to them. I understand that XQuery is functional and likes to pretend there are no side effects, but in practice, there are, no? We are defining file operations, and any time we touch external systems there is the potential for side effects.I'm not aware of any use cases where it's useful, but someone might well discover one. It's rather like the type empty-sequence(); it's logically necessary for completeness, but that doesn't mean it's useful in practice.Is it then a logical conclusion to try to avoid (never use) the xs:error type in XPath?