To anyone that has followed this thread and for the sake of
completion, thanks to Andy bug 364 has been fixed.

Many thanks

Alex

On Jun 27, 6:54 am, wcube <[email protected]> wrote:
> Hi all,
>
> I've run a simple test on Adobe CF 9 which returns the same value as
> BD.NET, i.e. array assignment is passed by value, and makes no
> difference whether it's var or not. It seems the oddity is with Open
> BD. Kindly advise, thanks.
>
> <cfset arTest=ArrayNew(1)>
>
> <cfset arTest[1] = "test abc">
> <cfset arTest[2] = "test recycle bin">
> <cfset arTest[3] = "test content">
>
> <cfset arTestNew = arTest>
>
> <cfset ArrayDeleteAt(arTest,2)>
>
> Variables:
> <cfdump var="#arTest#">
> <cfdump var="#arTestNew#">
>
> <cffunction name="testArray">
>         <cfset var arTest=ArrayNew(1)>
>
>         <cfset arTest[1] = "test abc">
>         <cfset arTest[2] = "test recycle bin">
>         <cfset arTest[3] = "test content">
>
>         <cfset var arTestNew = arTest>
>
>         <cfset ArrayDeleteAt(arTest,2)>
>         <br><br>
>         Var:
>         <cfdump var="#arTest#">
>         <cfdump var="#arTestNew#">
>
> </cffunction>
>
> <cfset testArray()>
>
> On Jun 24, 8:23 am, AlexS <[email protected]> wrote:
>
>
>
> > Hi Alan,
>
> > I appreciate there is some code in there that supports by value to
> > functions but it doesn't seem to be byvalue if the var keyword is used
> > inside the function which is where I think the inconsistency with ACF
> > is coming from. Using VAR or not I don't believe should alter the
> > behaviour.
>
> > Many thanks
>
> > A
>
> > On Jun 24, 1:11 am, "Alan Williamson (aw2.0 cloud experts)"
>
> > <[email protected]> wrote:
> > > I honestly can't believe someone actually designed it this way at ACF.  
> > > I mean how confusing do you want to make a language?   We all know some
> > > of the other quirks of the language which again, we've discussed
> > > historically on this list.
>
> > > Complex types should _always_ be passed by reference, never by value.  
> > > The fact they do in certain circumstances is just wrong.   The vast
> > > majority of languages operate this way.
>
> > > However, we do support this "wrongness" - ACF of passing an array by
> > > value to UDF functions.   Trust me, that is a whole host of code we
> > > would like to rip out of the engine/language.   Instead we provide a
> > > means to turn this off, which is a flag i have flipped all the time.
>
> > > The issue however isn't that passing arrays by value is wrong, what is
> > > wrong, is that ACF has failed to be consistent across everything.   Why
> > > should a UDF function be different from a built-in function?  This just
> > > makes it harder for the poor CFML developer to figure out whats-what.  
> > > Another area that they fail to provide is named-arguments for core
> > > functions (something we do).
>
> > > CFML is meant to be easy, straight forward and powerful.   We don't need
> > > these quirks.
>
> > > AlexS wrote:
> > > > Sorry the test case WW has posted doesn't show the whole picture but
> > > > her description does describe that this involves a method.
>
> > > > What we're seeing is that if the VAR keyword is not used then the
> > > > array is passed by Value into the function which is consistent with
> > > > normal Coldfusion behaviour.
>
> > > > However when the VAR keyword is used then it passes by reference.
>
> > > > Where as obviously with Structs in both instances its passed by
> > > > reference
>
> > > > Also note this 
> > > > urlhttp://www.bennadel.com/blog/141-ColdFusion-Arrays-Passed-By-Value.htm
> > > > which describes the scenario but actually I don't believe Open BD is
> > > > exhibiting this behaviour which i believe it should.
>
> > > > I haven't confirmed that CF9 behaves the same way but the inclusion of
> > > > not of the VAR keyword effecting arrays in this way to me seems odd.
>
> > > > A

-- 
official tag/function reference: http://openbd.org/manual/
 mailing list - http://groups.google.com/group/openbd?hl=en

Reply via email to