I have never been happy with the documentation nor the general handling of by reference/by value.
I think it is honestly more confusing to have certain data structures behave one way, yet others behave another. It may hide the complexity short-term but in the long run it requires cruft like the "StructCopy/ Duplicate" stuff. Point and case, Looking at the function names what is the difference in StructCopy and Duplicate. ??? You can't really tell. StructCopy creates a structure but "Top-level simple values and arrays are assigned by value". The documentation is ambiguous and probably confusing to most people. Its just funny business. In PHP I can control by reference/value with a simple ampersand and there is no language cruft really that has to work around the behavior of by reference/by value. Granted no language is perfect since some things are not very straight forward with PHP at first. One way or another, I just wish it was more concise and easy to handle in CF. All in all it is not TERRIBLE, but it certainly stands a huge amount of room for improvement. Perhaps even some diagrams and more careful wording in the documentation so that there is less ambiguity. Jeremy Allen elliptIQ Inc. -----Original Message----- From: Raymond Camden [mailto:[EMAIL PROTECTED]] Sent: Monday, November 12, 2001 10:40 AM To: CF-Talk Subject: RE: Request Scope Questions I don't know if you mean me, but if so, I did not say structcopy is faster. I said it _may_ be faster, but if so, most likely not in any significant manner. (If I'm wrong, sorry. As always, listen to what I _meant_ to say, not what I said. ;) ======================================================================= Raymond Camden, Principal Spectra Compliance Engineer for Macromedia Email : [EMAIL PROTECTED] Yahoo IM : morpheus "My ally is the Force, and a powerful ally it is." - Yoda > -----Original Message----- > From: Christopher Olive [mailto:[EMAIL PROTECTED]] > Sent: Monday, November 12, 2001 10:33 AM > To: CF-Talk > Subject: RE: Request Scope Questions > > > as ray points out, in "principle", structcopy should be > faster. by what > margin, i don't know. but the principle remains. > > christopher olive, cto, vp of web development > cresco technologies, inc > 410.825.0383 > http://www.crescotech.com > > > -----Original Message----- > From: Daniel Lancelot [mailto:[EMAIL PROTECTED]] > Sent: Monday, November 12, 2001 10:32 AM > To: CF-Talk > Subject: FW: Request Scope Questions > > > If this is the case, is there any disadvantage of doing > duplicate rather > than structcopy? - It would seem that duplicate would > always work... > > -----Original Message----- > From: Christopher Olive [mailto:[EMAIL PROTECTED]] > Sent: 12 November 2001 15:21 > To: CF-Talk > Subject: RE: Request Scope Questions > > > if i understand correctly, a week or so ago you (dave) mentioned that > duplicate was only necessary for a session structure if it contained > other complex variables. you said that StructCopy was > sufficient if it > was merely a structure with simple variables. is this correct? > > christopher olive, cto, vp of web development > cresco technologies, inc > 410.825.0383 > http://www.crescotech.com > > > -----Original Message----- > From: Dave Watts [mailto:[EMAIL PROTECTED]] > Sent: Sunday, November 11, 2001 5:00 PM > To: CF-Talk > Subject: RE: Request Scope Questions > > > > A couple of notes here: if you do this, use something like > > > > <cfset request.var=Duplicate(session.var)> > > > > to transfer the variable. If you don't use Duplicate() - correct > > me if I'm wrong someone! - then request.var just becomes a 'pointer' > > to session.var, and session.var is still actually read when you > > refer later to request.var (rendering the whole business kind of > > redundant!). Duplicate() - which is only available in CF4.5+ - > > makes request.var a 'deep' copy of session.var, and then request.var > > technically has nothing to do with session.var except having the > > same value. > > It's only necessary to use Duplicate in this case if Session.var is a > structure or a query. If it's just a simple value, you don't need to > worry - > simple values are always passed by value, not by reference. > > Dave Watts, CTO, Fig Leaf Software > http://www.figleaf.com/ > voice: (202) 797-5496 > fax: (202) 797-5444 > > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Get the mailserver that powers this list at http://www.coolfusion.com FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists