On 10/24/07, Sean Corfield <[EMAIL PROTECTED]> wrote:
> Yup, I did, and I expect I'll put that back at some point. It mixed in
> THIS scope and then called itself with different arguments to mixed in
> VARIABLES scope. It was non-trivial. I'll try to find it and add it
> back.

Ta-da!

<!--- put this code in your /WEB-INF/cftags/component.cfc file --->
<cfscript>
        function mixin(blender) {
                // initial call or recursive call?
                if (arrayLen(arguments) gte 2) {
                        // recursive call: blend our variables scope into the 
passed struct:
                        structAppend(blender,variables);
                } else {
                        // blend public scope from other object:
                        structAppend(this,blender);
                        // ask other object to blend its variables scope into 
ours:
                        blender.mixin(variables,0);
                }
                return this;
        }
</cfscript>
-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CFCDev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cfcdev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to