> You can circumvent this using duplicate( )
>
> <cfset test = duplicate(test())/>
>
> Which makes a deep copy of the object by value.

While you can do this, usually you shouldn't. Creating duplicate
objects is expensive, which is why the default behavior of CF is to
pass queries and structures by reference. This approach is common in
many other programming languages as well. You should only create a
deep copy when you explicitly want to have two separate variables that
will presumably be manipulated in different ways.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
http://training.figleaf.com/

Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on
GSA Schedule, and provides the highest caliber vendor-authorized
instruction at our training centers, online, or onsite.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:331516
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to