Re: [PHP] Arbitrary mathematical relations, not just hashes

2008-04-07 Thread Greg Bowser
On Sun, Apr 6, 2008 at 7:52 PM, Kelly Jones <[EMAIL PROTECTED]> wrote: > Many programming languages (including Perl, Ruby, and PHP) support hashes: > > $color['apple'] = 'red'; > $color['ruby'] = 'red'; > > $type['apple'] = 'fruit'; > $type['ruby'] = 'gem'; > > This quickly lets me find the color

Re: [PHP] Arbitrary mathematical relations, not just hashes

2008-04-07 Thread Greg Bowser
(sorry I just hit send on a blank email; I'm absent-minded) First, in the strictest mathematical sense, a relation from a set $a to a set $b is a subset of the cross-product $a x $b. (obviously, the mathematical notation is not a great way to represent this in a program.) Hence, a relation is a