[vox-tech] Matching Contents of Lists

Jay Strauss me at heyjay.com
Fri Jul 8 13:53:00 PDT 2005



Micah J. Cowan wrote:
> On Fri, Jul 08, 2005 at 10:28:00AM -0500, Jay Strauss wrote:
> 
>>Micah J. Cowan wrote:
> 
> 
> <snip>
> 
>>>First, you will need to create a comparison function, that will return
>>>an integer less than, greater than, or equal to zero depending on
>>>whether its first argument compares lexically less than, greater than,
>>>or equal to its second argument. This function should match based on
>>>your rules given above, and is meant as an analog for the cmp and <=>
>>>operators.
> 
> 
> <snip>
> 
>>Won't this just match identical records, and not account for his 
>>matching rules?  Seems like this is just a programmatic SQL join
> 
> 
> (Read the above paragraph).
> 

I didn't really know what you meant by "lexically".  I thought you might 
be saying:

return -1 if $a lt $b;
return 0 if $a eq $b;
return 1 if $a gt $b;

But I now understand, you want to build sophisticated comparison, maybe 
even character by character, to determine -1,0,1.  Seems hard, but 
you've probably already boiled it down to a one-liner :)

Jay


More information about the vox-tech mailing list