[Newbies] f(x, y) or Table

David T. Lewis lewis at mail.msen.com
Thu Apr 14 04:01:44 UTC 2016


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 at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/mailman/listinfo/beginners


More information about the Beginners mailing list