I see your point, but can’t you just pass in an additional argument to the method since then it shows up in the metadata as well?
We had a long discussion about supporting annotations in Railo or not. Some reasons why not:
- They make the compilation process slower for 99.9% of the cases
- Comments are stripped out by the compiler prior to the compilation process (this would need to change as well)
- Comments affect code at runtime
- You could use additional arguments/attributes to get additional metadata…
Those were the main reasons not to support it. I would appreciate any different point of view.
Greetings from Switzerland
Gert Franz
Railo Technologies Professional Open Source
skype: gert.franz ge...@getrailo.com
+41 76 5680 231 www.getrailo.com
Hey Mark,
I did some testing and found the following:
<cfdump var="#GetMetaData(testFailUpdate)#">
<cfdump var="#GetMetaData(testFailUpdate2)#">
<cfdump var="#GetMetaData(testFailUpdate3)#">
<cfscript>
/**
* test update
*
* @mxunit:expectedException coldspring.orm.hibernate.exception.StrictTransactionException
*/
public void function testFailUpdate()
{
}
public void function testFailUpdate2() mxunit:expectedException="coldspring.orm.hibernate.exception.StrictTransactionException"
{
}
</cfscript>
<cffunction name="testFailUpdate3" mxunit:expectedException="coldspring.orm.hibernate.exception.StrictTransactionException">
</cffunction>
testFailUpdate() works in CF and shows proper metadata, not in Railo
testfailUpdate1() works in Railo and shows proper metadata, throws a compiler error in CF
testfailUpdate2() works in Railo and CF and shows proper metadata
Which I guess your tweet is about… So at the moment you are either stuck to tag notation or use the ugly notation:
public void function testFailUpdate2() mxunit_expectedException="coldspring.orm.hibernate.exception.StrictTransactionException"
{
}
Which works in ACF and Railo.
I will let you know if we revisit the annotations…
Greetings from Switzerland
Gert Franz
Railo Technologies Professional Open Source
skype: gert.franz ge...@getrailo.com
+41 76 5680 231 www.getrailo.com
Von: ra...@googlegroups.com [mailto:ra...@googlegroups.com] Im Auftrag von Mark Mandel
Gesendet: Montag, 12. Dezember 2011 08:48
An: ra...@googlegroups.com
Betreff: Re: [railo] Can't apply custom meta to script functions with @ syntax?
* sigh *
public void function testFailUpdate2() mxunit:expectedException="coldspring.orm.hibernate.exception.StrictTransactionException"
{
}
But I guess my final point is - why make life more difficult for those people who write frameworks (who I would expect are the 99% of the people who have to support multiple engines) to support Railo?Mark
--
Hey Mark,
No problem at all, you are helping us find bugs in corners of Railo that, well are used by framework creators so it is important for us to fix those bugs as well.
The only thing I can say there is that some things won’t change in Railo since it would be a major drawback for CFML in general if we would follow the implementation ACF did. Like passing arrays by reference vs. by value. Thing is that ACF is the only language that does that. And what I tend to do if I need to pass in an array by reference as well is to do:
function susi (arrayAsStruct:struct) {
var aMyVal = arrayAsStruct.value;
…
}
susi( { value:[1,2,3,4] } );
Since ACF passes structs by reference and arrays not, I pass in a struct that contains an array which in that case would be passed by reference.
So thanks for all your help since not only ColdSpring2 will benefit of whatever we are fixing, but the other frameworks as well….
Greetings from Switzerland
Gert Franz
Railo Technologies Professional Open Source
skype: gert.franz ge...@getrailo.com
+41 76 5680 231 www.getrailo.com
Von: ra...@googlegroups.com [mailto:ra...@googlegroups.com] Im Auftrag von Mark Mandel
Gesendet: Montag, 12. Dezember 2011 13:27
An: ra...@googlegroups.com
Betreff: Re: [railo] Can't apply custom meta to script functions with @ syntax?
Nah, sorry - that's not my point at all. And sorry if it came off all accusatory, it wasn't my intention, so my apologies if that was the case.
i could think about a half way solution, supporting annotation just for meta data.this will work:* @susi Susannethis will be ignore or the compiler throws a exception.* @output true/micha