As of version 3.3.0.000 Railo now supports named arguments for Java based build in functions in the same way as it is already possible for user defined and cfml based build in functions. The only difference is that Railo throws a exception if you define an unsupported argument.
Here are some examples:
<cfset arr=[1,2,3,4]> <cfset dump(arrayLen(array: arr))> <cfset dump(arrayLen("array": arr))> <cfset dump(arrayContains(arr,2))> <cfset dump(arrayContains(haystack:arr,needle:2))> <cfset dump(arrayContains(needle:2,haystack:arr))> <cfset dump(arrayContains(object:2,array:arr))><--- using alias name ---> <cfset dump(arrayContains(o:2,arr:arr))><--- using alias name ---> <cfset dump(listAppend(value:'d',list:'a,b,c'))> <cfset dump(isValid(type:"string", value:arr))> <cfset dump(isValid(type:"regex", value:"string",pattern:"*"))> <cfset dump(isValid(type:"range", value:7,min:1,max:10))> <cfset dump(isValid(type:"range", value:17,min:1,max:10))>
The implications of this change are that you now don't have to obey the order of the parameters when calling a function. So instead of:
<cfoutput>#dateFormat(now(), "mm-dd-yyyy")#</cfoutput>
you could call:
<cfoutput>#dateFormat(mask:"mm-dd-yyyy",date:now())#</cfoutput>
In addition, if some arguments can be omitted and you need to pass in an argument that is at a latter position, you don't have to pass empty or dummy values for the rest of the arguments. Here's a very good example:
<cfset cachePut(id:myID, value:myVar, cacheName:"myCache")>