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

Joseph Alotta joseph.alotta at gmail.com
Fri Apr 15 01:38:31 UTC 2016


thank you.



> On Apr 14, 2016, at 10:54 AM, Ron Teitelbaum [via Smalltalk] <ml-node+s1294792n4890068h57 at n4.nabble.com> wrote:
> 
> Hi Joseph, 
> 
> | aPoint aDictionary | 
> 
> aPoint := Point x: 1 y: 2. 
> aDictionary := Dictionary new. 
> aDictionary at: aPoint put: 'Success!'. 
> ^aDictionary at: aPoint 
> 
> Everything in Smalltalk is an object.  You can use a number or string as 
> your dictionary key but you can also use more complex objects like a Point. 
> 
> The object matching is implemented in #=.  If the objects match then the 
> value will be returned.   
> 
> All the best, 
> 
> Ron Teitelbaum 
> 
> > -----Original Message----- 
> > From: [hidden email] [mailto:beginners- 
> > [hidden email]] On Behalf Of Joseph Alotta 
> > Sent: Wednesday, April 13, 2016 9:46 PM 
> > To: [hidden email] 
> > Subject: [Newbies] f(x, y) or Table 
> > 
> > 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 
> > [hidden email] 
> > http://lists.squeakfoundation.org/mailman/listinfo/beginners
> 
> _______________________________________________ 
> 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-tp4889801p4890068.html
> To start a new topic under Squeak - Beginners, email ml-node+s1294792n107673h12 at 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-tp4889801p4890103.html
Sent from the Squeak - Beginners mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/beginners/attachments/20160414/1b42d0ba/attachment.htm


More information about the Beginners mailing list