I wouldn't expect it to be possible with the existing scope collections like form or with native data types like arrays. In most cases I wouldn't expect this to really be something people look for, largely because it's not necessary for any custom framework (form validation for instance) that I'm aware of -- using native functions and UDF's that work on arrays and structures directly (<cfset checkformdata()> or <cfset x = arraylen(myarray)>) isn't a workaround : it's the way it's done to begin with.
Now if you're talking about adding methods to CFC's at runtime, such as <cfset myCFC.doSomething = myUDF> that's a whole other story (and I suspect could be useful in some situations, just as it is sometimes useful to group UDF's into request structures and the like). I haven't got any clue if MX supports it. I half expect it to be supported already, but I also half expect it to not be supported. If it is supported, then rebuilding the scopes (form,url,attributes,variables,request,etc) as CFC's similar to the new custom java class for the Arguments array in functions, if these scopes aren't already defined this way would provide the other functionality (although I'm not sure if I agree that would be an advantage). > Is there a way to attach a method/function to cf variable, > be it a > string, array, structure, etc at runtime? I don't think > this is > possible now, but it just popped into my head, and before > I headed to > the wishform, I was wondering if it, or a creative > workaround already > existed. > For example, attaching a validate method to the form > collection, or a > length method to an array. > -- > mailto:[EMAIL PROTECTED] > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > ~~~~~~~~~~~| > Archives: > http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 > Subscription: http://www.houseoffusion.com/cf_lists/index. > cfm?method=subscribe&forumid=4 > FAQ: http://www.thenetprofits.co.uk/coldfusion/faq > This list and all House of Fusion resources hosted by > CFHosting.com. The place for dependable ColdFusion > Hosting. > Unsubscribe: http://www.houseoffusion.com/cf_lists/uns > ubscribe.cfm?user=633.558.4 s. isaac dealey 954-776-0046 new epoch http://www.turnkey.to lead architect, tapestry cms http://products.turnkey.to tapestry api is opensource http://www.turnkey.to/tapi certified advanced coldfusion 5 developer http://www.macromedia.com/v1/handlers/index.cfm?ID=21816 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4