Blog Archive
-
►
2009
(2)
- ► 06/28 - 07/05 (2)
-
►
2008
(2)
- ► 11/16 - 11/23 (2)
-
►
2007
(1)
- ► 01/07 - 01/14 (1)
-
►
2005
(21)
- ► 10/30 - 11/06 (1)
- ► 09/11 - 09/18 (1)
- ► 09/04 - 09/11 (1)
- ► 05/08 - 05/15 (1)
- ► 04/24 - 05/01 (1)
- ► 04/17 - 04/24 (1)
- ► 04/10 - 04/17 (2)
- ► 04/03 - 04/10 (2)
- ► 02/06 - 02/13 (1)
- ► 01/30 - 02/06 (5)
- ► 01/23 - 01/30 (5)
-
►
2004
(6)
- ► 11/21 - 11/28 (1)
- ► 10/17 - 10/24 (2)
- ► 10/03 - 10/10 (1)
- ► 09/19 - 09/26 (1)
- ► 09/05 - 09/12 (1)
-
►
2003
(12)
- ► 01/12 - 01/19 (11)
- ► 01/05 - 01/12 (1)
-
▼
2002
(54)
- ► 12/29 - 01/05 (2)
- ► 11/24 - 12/01 (1)
- ► 11/10 - 11/17 (2)
- ► 10/13 - 10/20 (1)
- ► 10/06 - 10/13 (1)
- ► 07/07 - 07/14 (2)
- ► 05/19 - 05/26 (2)
- ► 05/05 - 05/12 (3)
- ► 04/28 - 05/05 (1)
- ► 04/21 - 04/28 (7)
- ► 04/07 - 04/14 (3)
- ► 03/17 - 03/24 (1)
- ► 03/10 - 03/17 (2)
- ▼ 03/03 - 03/10 (3)
- ► 02/24 - 03/03 (1)
- ► 02/17 - 02/24 (14)
- ► 02/10 - 02/17 (8)
Wednesday, March 06, 2002
Tuesday, March 05, 2002
The body of the for-each is a template, like the body of xsl:template each
time you go round the loop the template body is instantiated again and you get a
new variable called here, its scope ends at the end of that template body, ie
effectively you get a new variable created and discarded each time round the
loop.
Note this is completely different from the use of variables in loops in
procedural languages where the _same_ variable survives throughout the loop,
carrying state information (like how many times the loop has been executed).
The "variable value can't change" mantra refers to the fact that there is not
an analogue of x=x+1 which some people, corrupted by procedural languages seem
to feel is a natural thing to write, whereas it is obviously an affront to the
laws of nature, unless x happens to be 0:-)