----- Original Message -----
From: "Matthew Walker" <[EMAIL PROTECTED]>

> May be missing what you're trying to do, but how about generating a uuid
> and then having another structure linking uuids to structures.
>
> <cfset aKey = CreateUUID()>
> <cfset myStructs[aKey] = AStructure>
>

Yea, no :-)  Perhaps I explained it badly.

What I want to do is boil an _arbitrary_ structure down to a small value of
some sort such that with two of these values I can compare the structures
for functional equivalence (i.e same keys, same values for those keys but
not necessarily same order in the underlying datastructure (admittedly my
WDDX method doesn't work correctly for different ordering (or case) of keys
it'll produce distinct keys for thoe functionally equivalent structures)).

Example pseudocode lets say it's called blah.cfm...

Code...

<CFPARAM NAME="SESSION.LastKey" DEFAULT="">

<CFIF Len(SESSION.LastKey)>
    <CFIF SESSION.LastKey eq boilDown(URL)>
        Same
    <CFELSE>
        Different
    </CFIF>
<CFELSE>
    Initial key stored.
</CFIF>

<CFSET SESSION.LastKey = boilDown(URL)>

Output...

1. blah.cfm?hello=goodbye&goodbye=hello    ==> Initial key stored.
2. blah.cfm?hello=goodbye&goodbye=hello    ==> Same.
3. blah.cfm?goodbye=hello&hello=goodbye    ==> Same.
4. blah.cfm?foo=bar                                        ==> Different.


Note that 2 & 3, while the order is different, functionally they are
equivalent and so they both report same.  I've only used the URL scope here
because it's an easy structure for an example, but in my application there
is the possibility of nested structures, arrays and queries in the
structures to be compared.




---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.384 / Virus Database: 216 - Release Date: 24/08/2002

______________________________________________________________________
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to