Arbitrary mathematical relations, not just hashes

2008-04-06 Thread Kelly Jones
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 or type of a given item. In this sense, color() and type() are like mathematical funct

Re: Arbitrary mathematical relations, not just hashes

2008-04-06 Thread Mr. Shawn H. Corey
On Sun, 2008-04-06 at 16:52 -0700, Kelly Jones 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 or type of a gi

Re: Arbitrary mathematical relations, not just hashes

2008-04-07 Thread Julian Leviston
You could use ActiveRecord. Julian. Learn Ruby on Rails! CHECK OUT THE FREE VIDS (LIMITED TIME) VIDEO #3 OUT NOW http://sensei.zenunit.com/ On 07/04/2008, at 9:52 AM, Kelly Jones wrote: Many programming languages (including Perl, Ruby, and PHP) support hashes: $color['apple'] = 'red';

Re: Arbitrary mathematical relations, not just hashes

2008-04-07 Thread Jenda Krynicky
From: "Kelly Jones" <[EMAIL PROTECTED]> > 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 or type of a given item. > >

Re: Arbitrary mathematical relations, not just hashes

2008-04-07 Thread Jenda Krynicky
From: Julian Leviston <[EMAIL PROTECTED]> > You could use ActiveRecord. Without a database? I guess not. You'd still need at least SQLite. But you are right, you could use ActiveRecord to obtain a nice object oriented wrapper around the database so that it doesn't scare you. Or, assuming you do

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

2008-04-06 Thread Casey
On Sun, Apr 6, 2008 at 4: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 co

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

2008-04-07 Thread Mark J. Reed
As far as languages with two-way relation go, there are many; perhaps the most prototypical is Lisp, in that either member of a pair within an alist can be used to look the pair up, with no extra function or second map definition required. But PHP has pretty good support, too, actually. If you ha

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

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 Casey
On Sun, Apr 6, 2008 at 4: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 co

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

2008-04-07 Thread Mark J. Reed
On Sun, Apr 6, 2008 at 11:51 PM, Casey <[EMAIL PROTECTED]> wrote: > I hit reply-all... now am I suddenly subscribed to Perl and Ruby lists!?! Huh, didn't notice the cross-posting. But no, you're not subscribed to any new lists. Since we're cross-posting, the translation of my sample would be ap

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

2008-04-07 Thread Paul Johnson
On Sun, Apr 06, 2008 at 08:51:00PM -0700, Casey wrote: > I hit reply-all... now am I suddenly subscribed to Perl and Ruby lists!?! Be careful. Next time you do it you'll be subscribed to Haskell, OCaml and Smalltalk lists. Bwahahaha! -- Paul Johnson - [EMAIL PROTECTED] http://www.pjcj.net --