|
Re: subclasses detect: msg#00153lang.smalltalk.squeak.beginners
Its returning the actual matched class object. Not a symbol. - Steve Sent from my iPhone On Jul 31, 2007, at 3:14 PM, gruntfuttuck <gruntfuttuck@xxxxxxxxx> wrote: Hello In the laser game tutorial by Stephan B Wessels I was intrerested by this code: directionFor: aSymbol ^ self subclasses detect: [:cls | cls directionSymbol = aSymbol] The code appears here at the bottom of the page: http://squeak.preeminent.org/tut2007/html/038.html What I read this code as doing, in this example is: return an symbol object which is a sublass instance varable, if it is the same as aSymbol. What would happen if more than one subclass object had a match? Also how else can subclasses detect: be used? It looks very interesting. Grunt -- View this message in context: http://www.nabble.com/subclasses-detect-tf4196202.html#a11934239 Sent from the Squeak - Beginners mailing list archive at Nabble.com. _______________________________________________ Beginners mailing list Beginners@xxxxxxxxxxxxxxxxxxxxxxxxxx http://lists.squeakfoundation.org/mailman/listinfo/beginners ____________________________________________________________________________________ Take the Internet to Go: Yahoo!Go puts the Internet in your pocket: mail, news, photos & more. http://mobile.yahoo.com/go?refer=1GNXIC
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: PostGreSQL client for Squeak?, gruntfuttuck |
|---|---|
| Next by Date: | Re: subclasses detect, David Mitchell |
| Previous by Thread: | Re: subclasses detect, gruntfuttuck |
| Next by Thread: | Re: subclasses detect, Steve Wessels |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |