[xquery-talk] a conceptual clarification

Michael Rys mrys at microsoft.com
Fri Mar 4 14:27:03 PST 2005



> -----Original Message-----
> From: talk-bounces at xquery.com [mailto:talk-bounces at xquery.com] On
Behalf
> Of David Sewell
> Sent: Friday, March 04, 2005 2:16 PM
> To: talk at xquery.com
> Subject: Re: Re : [xquery-talk] a conceptual clarification
> 
> 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.

[Michael Rys] I think the point that Jason wanted to make was that this
may generate a side-effect. But in XQuery the above function is actually
valid and implies the return type item() if I remember correctly.

> DS
> 
> (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?)

[Michael Rys] What about XPath 2.0? APL, several "scripting" languages
etc. Oh, you said common... never mind... :-)
 
> --
> 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/
> _______________________________________________
> talk at xquery.com
> http://xquery.com/mailman/listinfo/talk



More information about the talk mailing list