Issue 14557: Provide a way for users to get the iteration count in a for loop (mtt-rtf) Source: (, ) Nature: Enhancement Severity: Minor Summary: MTL Currently specifies a "for-each" kind of loop, with no possibility for the user to know the index of the current iteration in the list of values they're iterating over. It would be nice to have access to an implicit variable within for loops to get this index. Something like [for (value : String | Sequence{'a', 'b', 'c'})/] [i/] = [value/] [/for] would then generate text : 1 = a 2 = b 3 = c I named this implicit variable "i" in this example, it could be named "iterationCount" or "iterationIndex" if we want to avoid conflicts... Yet I'd rather it be named "i" myself. Resolution: Revised Text: Actions taken: October 13, 2009: received issue Discussion: End of Annotations:===== m: webmaster@omg.org Date: 13 Oct 2009 07:55:45 -0400 To: Subject: Issue/Bug Report ******************************************************************************* Name: Laurent Goubet Company: Obeo mailFrom: laurent.goubet@obeo.fr Notification: Yes Specification: MOF Model to Text Transformation Language (MOFM2T) Section: 8.1.8 FormalNumber: formal/2008-01-16 Version: 1.0 RevisionDate: 01/16/08 Page: 17 Title: Provide a way for users to get the iteration count in a for loop Nature: Enhancement Severity: Minor test: 3qw8 B1: Report Issue Description: MTL Currently specifies a "for-each" kind of loop, with no possibility for the user to know the index of the current iteration in the list of values they're iterating over. It would be nice to have access to an implicit variable within for loops to get this index. Something like [for (value : String | Sequence{'a', 'b', 'c'})/] [i/] = [value/] [/for] would then generate text : 1 = a 2 = b 3 = c I named this implicit variable "i" in this example, it could be named "iterationCount" or "iterationIndex" if we want to avoid conflicts... Yet I'd rather it be named "i" myself.