33 messages in com.x-query.talkRe: [xquery-talk] XQuery Style Conven...
FromSent OnAttachments
McBeath, Darin W (ELS-AMS)20 Oct 2005 12:30 
Raffaele Sena20 Oct 2005 16:00 
Michael Rys20 Oct 2005 18:35 
Michael Kay21 Oct 2005 01:42 
Martin Probst21 Oct 2005 02:17 
Martin Probst21 Oct 2005 03:00 
McBeath, Darin W (ELS-AMS)21 Oct 2005 06:53 
Joel Stewart21 Oct 2005 07:03 
McBeath, Darin W (ELS-AMS)21 Oct 2005 11:03 
Michael Kay21 Oct 2005 12:45 
David Sewell22 Oct 2005 09:35 
Michael Kay22 Oct 2005 10:47 
Michael Kay22 Oct 2005 13:09 
Liam Quin22 Oct 2005 18:06 
David Sewell22 Oct 2005 20:31 
Martin Probst24 Oct 2005 01:09 
Frank Cohen24 Oct 2005 07:33 
Frank Cohen24 Oct 2005 07:35 
Ronald Bourret24 Oct 2005 10:05 
Michael Kay24 Oct 2005 15:28 
McBeath, Darin W (ELS-AMS)26 Oct 2005 06:48 
Michael Dyck26 Oct 2005 11:52 
Till Westmann27 Oct 2005 23:11 
Martin Probst28 Oct 2005 02:21 
Michael Rys28 Oct 2005 09:34 
Till Westmann28 Oct 2005 22:22 
Till Westmann28 Oct 2005 22:24 
Per Bothner29 Oct 2005 00:54 
Michael Kay29 Oct 2005 01:29 
Till Westmann29 Oct 2005 15:30 
David Sewell16 Nov 2005 09:22 
Michael Kay16 Nov 2005 10:37 
Michael Kay17 Nov 2005 04:43 
Subject:Re: [xquery-talk] XQuery Style Conventions
From:Till Westmann (till@bea.com)
Date:10/28/2005 10:22:52 PM
List:com.x-query.talk

On Oct 28, 2005, at 2:21 AM, Martin Probst wrote:

Personally, I prefer to keep them all at the same level to keep the query compact (and it also fits well with the grammar).

Well, if you have queries going over hundreds of lines with >10 different for/let clauses, it is actually very helpful to get at least a guess at which level of loop nesting you are. Otherwise you just have a long sequence of statements on the same indentation level, so the indentation doesn't give you any information.

As a FLWOR expression can have any number of for and let clauses but only one of each of the other clauses, all the expressions that are evaluated based on the variable bindings of the for and let clauses are evaluated at the same level. That level is given by the number of for clauses in the FLWOR. (Whenever there is a nested FLWOR in a where or return clause there should obviously be some form of indentation.) So the trade-off is between counting for clauses and wasting columns. I think that saving columns is worth counting for clauses.

Best regards, Till