While there are some real humdingers in there. But as a typeless
language, we as CFML suffer from some of the things there that they
list as WTF where in actual fact we embrace in CFML. For example, 3
== "3"
For me, that has been one of the frustrating things with CFML at
times, is identifying which edge cases are in actual fact there by
design, or just by sheer fluke. It is the "sheer fluke" situations
that scare me, as they become folklore and expected to be there till
the end of time.
It would be nice to come up with a running list of things that should
be deprecated and eventually eliminated if there's no rational
justification for their existence. This way people would know well in
advance and since this is an open list, we'd hear from people who
might have legitimate arguments for some of these oddities.
At this point in CFML's history I think some cleanup is definitely in
order, and we certainly don't want to exacerbate the situation by
introducing new WTFs as new features are added to the language.
I think we could propose adding an extra couple of attributes so we
didn't break backward compatability, but at the same time, clean up a
lot of confusion for new people coming to CFML
<cfloop collection="#c#" key="mykey">
<cfset a = c[ mykey ]>
</cfloop>
<cfloop array="#a#" element="el">
</cfloop>
On Feb 19, 4:47 am, Dennis Clark <boomf...@gmail.com> wrote:
> Keys are a structure's equivalent of array indexes, so why didn't Adobe use
> the "index" attribute for looping over structure keys in a collection loop,
> and use the "item" attribute for looping over the structure *values* in a
> collection loop?
MD
On 19 Feb 2010, at 02:27, cfchris wrote:
> I can't understand why Adobe used the "index" attribute for "Array"
> loops. What you really get is a handle on the "item" in the array. So,
> since there is already a "collection" loop that uses an "item"
> attribute, why did Adobe use "index"? And would it be a big deal to
> make it work with the "item" attribute while leaving support for
> "index"?
Mark Drew
Railo Technologies UK
Professional Open Source
skype: mark_railo
email: ma...@getrailo.com
gtalk: ma...@getrailo.com
tel: +44 7971 85 22 96
web: http://www.getrailo.com
On 19 Feb 2010, at 07:58, Alan Williamson wrote:
> <cfloop collection="#c#" key="mykey">
> <cfset a = c[ mykey ]>
> </cfloop>
Mark Drew