As of ColdFusion 8 we have been able to pass a struct into a method so it becomes the method's argument collection without knowing the individual keys in the struct.
- I cannot verify if there are any bad side effects of using apply() this way-- I just know it works.
- This may also be possible with the use of eval() but I like this better.
- I didn't specify the arguments to foo in its declaration, but there is nothing keeping you from doing it. If you did, you would be able to refer to your arguments by name as opposed to looping over the argument array like I did.