Title:
Rasing bug#3495357 again because you didn't look into the problem before closing it.
| View in TrackerStatus/Resolution/Reason: Closed/Fixed/
Reporter/Name(from Bugbase): Andrew Scott / Andrew Scott (Andrew Scott)
Created: 10/01/2013
Components: Documentation
Versions: 10.0
Failure Type:
Found In Build/Fixed In Build: Final /
Priority/Frequency: Major / All users will encounter
Locale/System: English / Win 2008 Server
Vote Count: 1
Problem Description:
In trying to give you examples of the problem that bug #3495357 raises, I discovered that your own documentation is hindering this feature. There is no structure on how to learn this, by that I mean the documentation is all over the place and people have to bend over backwards searching for hidden information.
If you want to provide documentation like this.
http://groovy.codehaus.org/Closures
Finding anything like this for ColdFusion, is what really kills this language. Anyway back to the previous bug.
That code become a result of this in your documentation, which clearly indicates that what I was asking for was indeed on the cards at one stage and pulled out of the code.
Because not only does this code in your documentation not work, but it gives people a false sense of how it all is supposed to work. I have searched high and low on materials, blogs and anything I can find that would explain how Closures actually work and can be used in ColdFusion.
function exampleClosure(arg1)
{
function exampleReturned(innerArg)
{
return innerArg + owner.arg1;
}
/*
return a reference to the inner function defined.
*/
return exampleReturned;
}
Guess what, nobody really knows 100% how it works, especially when your documentation shows the above. And then in comparison to the other bug #3495357, it goes well how does this actually work then.
For example lets take this code.
function helloTranslator(String helloWorld) {
return function(String name) {
return "#helloWorld#, #name#";
};
}
var test = helloTranslator("Andy");
writeDump(test());
Will error saying that the variable name is undefined, yet it is valid, extremely valid ColdFusion code. So if we then take the initiative to refactor it to what we think it should be.
function helloTranslator(String helloWorld) {
return function(String name) {
return "#helloWorld#, #arguments.name#";
};
}
var test = helloTranslator("Andy");
writeDump(test());
Then presents an error that the variable name doesn't exist in arguments.
So either this is bugged or your documents are wrong!
Steps to Reproduce:
Actual Result:
Expected Result:
Any Workarounds:
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 3644083
Deployment Phase: Release Candidate
External Customer Info:
External Company:
External Customer Name: ascott67
External Customer Email:
External Test Config: My Hardware and Environment details:
Attachments:
Comments: