<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: JSON-ish method for creating ColdFusion structures</title>
	<atom:link href="http://www.ghidinelli.com/2006/08/18/json-ish-method-for-creating-coldfusion-structures/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ghidinelli.com/2006/08/18/json-ish-method-for-creating-coldfusion-structures</link>
	<description></description>
	<pubDate>Fri, 22 Aug 2008 03:34:40 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>By: Gatzby</title>
		<link>http://www.ghidinelli.com/2006/08/18/json-ish-method-for-creating-coldfusion-structures#comment-365</link>
		<dc:creator>Gatzby</dc:creator>
		<pubDate>Tue, 19 Sep 2006 13:05:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.ghidinelli.com/2006/08/18/json-ish-method-for-creating-coldfusion-structures/#comment-365</guid>
		<description>A quick way to create an array is to use the ListToArray() function:

myArray=ListToArray("alpha,beta,gamma,delta");

No such trick for structs, though. I used a custom tag for a while, but that isn't much use in cfscript:

&lt;code&gt;&#60;cf_struct _name="greek" first="alpha" seond="beta" third="gamma" [...] /&#62;&lt;/code&gt;

The custom tag simply loops through it's attributes struct and uses the _name attribute to create a struct of that name in the caller scope.</description>
		<content:encoded><![CDATA[<p>A quick way to create an array is to use the ListToArray() function:</p>
<p>myArray=ListToArray(&#8221;alpha,beta,gamma,delta&#8221;);</p>
<p>No such trick for structs, though. I used a custom tag for a while, but that isn&#8217;t much use in cfscript:</p>
<p><code>&lt;cf_struct _name="greek" first="alpha" seond="beta" third="gamma" [...] /&gt;</code></p>
<p>The custom tag simply loops through it&#8217;s attributes struct and uses the _name attribute to create a struct of that name in the caller scope.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: brian</title>
		<link>http://www.ghidinelli.com/2006/08/18/json-ish-method-for-creating-coldfusion-structures#comment-215</link>
		<dc:creator>brian</dc:creator>
		<pubDate>Fri, 18 Aug 2006 20:59:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.ghidinelli.com/2006/08/18/json-ish-method-for-creating-coldfusion-structures/#comment-215</guid>
		<description>Good points.  Nathan Dintenfass also mentioned that you could reduce the amount of typing using the foo.values[1] = 0; foo.values[2] = 5; syntax, but I would prefer a function based shortcut (if we can't have "CFON").

Where do you store these for easy access?  App scope?  Request scope?  CFC?</description>
		<content:encoded><![CDATA[<p>Good points.  Nathan Dintenfass also mentioned that you could reduce the amount of typing using the foo.values[1] = 0; foo.values[2] = 5; syntax, but I would prefer a function based shortcut (if we can&#8217;t have &#8220;CFON&#8221;).</p>
<p>Where do you store these for easy access?  App scope?  Request scope?  CFC?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dan G. Switzer, II</title>
		<link>http://www.ghidinelli.com/2006/08/18/json-ish-method-for-creating-coldfusion-structures#comment-214</link>
		<dc:creator>Dan G. Switzer, II</dc:creator>
		<pubDate>Fri, 18 Aug 2006 20:06:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.ghidinelli.com/2006/08/18/json-ish-method-for-creating-coldfusion-structures/#comment-214</guid>
		<description>To create an array, just write a UDF called arrayCreate() (I use structCreate() and arrayCreate() to be more consistent w/CF nomenclature) you need to loop through the arguments array. It's not a true array--but some kind of hybrid struct/array.

If you don't create the array by looping through the arguments array, some of the array functions won't work on it.

I actually use both UDFs in my work as it does make it much easier to create arrays and structures.

I'd really like to see these functions become native to CF.

PS - The reason I don't like using the listToArray() is you can't use the delimiter in your values or it creates a problem. Having a true UDF that converts an list of arguments to an array is much more useful.</description>
		<content:encoded><![CDATA[<p>To create an array, just write a UDF called arrayCreate() (I use structCreate() and arrayCreate() to be more consistent w/CF nomenclature) you need to loop through the arguments array. It&#8217;s not a true array&#8211;but some kind of hybrid struct/array.</p>
<p>If you don&#8217;t create the array by looping through the arguments array, some of the array functions won&#8217;t work on it.</p>
<p>I actually use both UDFs in my work as it does make it much easier to create arrays and structures.</p>
<p>I&#8217;d really like to see these functions become native to CF.</p>
<p>PS - The reason I don&#8217;t like using the listToArray() is you can&#8217;t use the delimiter in your values or it creates a problem. Having a true UDF that converts an list of arguments to an array is much more useful.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
