[xquery-talk] a conceptual clarification

David Sewell dsewell at virginia.edu
Fri Mar 4 17:16:10 PST 2005

On Fri, 4 Mar 2005, Jason Hunter wrote:

> I can understand the argument that it can be confusing to people, but so is
> functional programming in general.  If we go down the "it can be confusing"
> path, the next logical step is to make the following work because it's not
> working sure is confusing to people:
> declare function x() {
>   return 5
> };

Having learned XPath 2.0 by way of learning XQuery, I did find this
confusing. In the future, I suspect, more people will come to XQuery by
way of XSLT 2.0, and they will have internalized the syntax of the
for-clause as "for $n in something return something", so they'll think
of "return" as bound to something else, rather than as a seemingly
"independent" part of a FLOWR expression.


(off-topic question: is there any other common programming language out
there in which a one-line string literal like

   "Hello, world!"

is a complete and valid 'program' as it is in XQuery?)

David Sewell, Editorial and Technical Manager
Electronic Imprint, The University of Virginia Press
PO Box 400318, Charlottesville, VA 22904-4318 USA
Courier: 310 Old Ivy Way, Suite 302, Charlottesville VA 22903
Email: dsewell at virginia.edu   Tel: +1 434 924 9973
Web: http://www.ei.virginia.edu/

More information about the talk mailing list