> 2. Formurl2attributes creates copies of form and url variables, thus
> doubling the server memory used for those scopes in Fusebox apps.
> I'd much rather see a means to use a structure of pointers that
> would cover form-, url-, and attributes-scoped variables. This
> would accomplish the same goals as using the current approach,
> while streamlining memory use and providing a complete structure
> for accessing variables "passed into" a Fusebox module.

Maybe a new function, lets say GetPointer(variable), should be implemented
in CF? CF handles pointers internally now anyway (when copying sturctures
that have structures inside like <cfset st2 = st1> them etc). So if there
was a special function that could get the pointer for simple variables
too, that would be the ultimate thing, right?

Then formURL2attributes could be something like this:

<cfif NOT StructIsEmpty(url)>
  <cfloop collection="#url#" item="urlname">
    <cfif NOT StructKeyExists(caller.attributes, urlname)>
      <cfset caller.attributes[urlname] = GetPointer(url[urlname])>
    </cfif>
  </cfloop>
</cfif>
<cfif NOT StructIsEmpty(form)>
  <cfloop collection="#form#" item="field">
    <cfif NOT StructKeyExists(caller.attributes, field)>
      <cfset caller.attributes[field] = GetPointer(form[field])>
    </cfif>
  </cfloop>
</cfif>

Erki


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to