tracker issue : CF-4122711

select a category, or use search below
(searches all categories and all time range)
Title:

Add conformity to <cfloop> collection iteration

| View in Tracker

Status/Resolution/Reason: Needs Review//

Reporter/Name(from Bugbase): Adam Cameron / Adam Cameron (Adam Cameron)

Created: 02/29/2016

Components: Language

Versions: 2016

Failure Type: Enhancement Request

Found In Build/Fixed In Build: CF2016_Final /

Priority/Frequency: Trivial / Unknown

Locale/System: English / Platforms All

Vote Count: 3

ColdFUsion 2016 added new syntax to <cfloop>:

{code:java}
<cfloop array="#someArray#" index="i" item="element">
<cfloop array="#someArray#" item="element">
{code}


Similar syntax was added for files and lists:

{code:java}
<cfloop file="#someArray#" index="i" item="element">
<cfloop file="#someArray#" item="element">
<cfloop list="#someArray#" index="i" item="element">
<cfloop list="#someArray#" item="element">
{code}


This is a reasonable start, but I think it warrants further fine-tuning:


{code:java}
<cfloop collection="#collection#" index="k" element="element">
{code}


Where collection can be anything iterable, eg:
array
struct
list
query
file (file object, not path)
[perhaps anything else which implements an Iterable interface]

This would help keep the language more predictable.

At the same time, all the other looping constructs should be deprecated.

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	4122711

External Customer Info:
External Company:  
External Customer Name: Adam Cameron
External Customer Email:  
External Test Config: My Hardware and Environment details:

Attachments:

Comments: