Re: [Newbies] f(x, y) or Table

2016-04-13 Thread David T. Lewis
Represent your data as objects. If you are thinking of using a dictionary
to map key -> value, and you have z := f(x,y) as a function that maps x,y
to z, then make x,y be an object, and let that be the key in your dictionary
pointing to value z.

So define a class that represents x and y.

If you have a good data model, you can represent it with objects. If you
can not represent it with objects, then you probably can not represent in
in a relational database either, so revisit the data model.

Note that an index in the database sense is not the same thing as the x,y
that you are asking about. if you think in terms of tables in a database,
then x and y might be parameters in a select statement and the tables might
or might not have indices to make the query run more efficiently.

Dave


On Wed, Apr 13, 2016 at 08:46:03PM -0500, Joseph Alotta wrote:
> Greetings,
> 
> I find a lot of my data needs two indices, f(x,y) instead of one, f(x).
> 
> f(x) would be implemented easily with a Dictionary,
> 
> but how do you implement f(x,y)?
> 
> 
> I guess this is another way of asking is there a Table object or a Tuple 
> object,
> 
> of even a graphics object Screen that has x,y coordinates with a value?
> 
> 
> Sincerely,
> 
> Joe.
> 
> 
> 
> 
> 
> 
> ___
> Beginners mailing list
> Beginners@lists.squeakfoundation.org
> http://lists.squeakfoundation.org/mailman/listinfo/beginners
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


[Newbies] Re: f(x, y) or Table

2016-04-13 Thread Joseph Alotta




> On Apr 13, 2016, at 8:15 PM, jelena [via Smalltalk] 
>  wrote:
> 
> 
> ___ 
> Beginners mailing list 
> [hidden email] 
> http://lists.squeakfoundation.org/mailman/listinfo/beginners
> 
> 
> If you reply to this email, your message will be added to the discussion 
> below:
> http://forum.world.st/f-x-y-or-Table-tp4889801p4889802.html
> To start a new topic under Squeak - Beginners, email 
> ml-node+s1294792n107673...@n4.nabble.com 
> To unsubscribe from Squeak - Beginners, click here.
> NAML





--
View this message in context: 
http://forum.world.st/f-x-y-or-Table-tp4889801p4889803.html
Sent from the Squeak - Beginners mailing list archive at Nabble.com.___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] f(x, y) or Table

2016-04-13 Thread

___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


[Newbies] f(x, y) or Table

2016-04-13 Thread Joseph Alotta
Greetings,

I find a lot of my data needs two indices, f(x,y) instead of one, f(x).

f(x) would be implemented easily with a Dictionary,

but how do you implement f(x,y)?


I guess this is another way of asking is there a Table object or a Tuple object,

of even a graphics object Screen that has x,y coordinates with a value?


Sincerely,

Joe.






___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners