|
Re: Understanding "self": msg#00148lang.smalltalk.squeak.beginners
Hi Andy, The scope of the block is taken from were it is define not were it is evaluate. If no then yo couldn't write code like this for example: aCollection detect:[:each | self maxValue < each] One solution to what you want could be to add a parameter: aVar := AnotherObj new aVar setBlockTo: [:arg | Transcript show: arg] aVar block value: self. On Jan 30, 2008, at 6:43 PM, Andy Burnett wrote: I am working through the SBE book ( which is really very good) and I have been experimenting with using self in blocks. Mth
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Understanding "self", Andy Burnett |
|---|---|
| Next by Date: | Tracking down an obsolete class from a RefactoringBrowser / ClassOrganizer, stan414 |
| Previous by Thread: | Understanding "self", Andy Burnett |
| Next by Thread: | Tracking down an obsolete class from a RefactoringBrowser / ClassOrganizer, stan414 |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |