> 2011/8/12 Stéphane Ducasse <[email protected]>: >> You are really lucky. >> One the last dinosaurs.... there are rarer and rarer. >> May be you can improve with a timesRepeat: >> > > Yes, good idea, refactoring with an even worse hack is a good joke, > For example (thisContext asManyTimes: 6) repeat sender
Excellent idea. We will get more compact code :) We had a really good laugh. Pharo will become much more serious in the future so we should chase these dinosaurs now :) > Object>>asManyTimes: anInteger > ^ManyTimesProxy target: self times: anInteger > > ManyTimesProxy>>repeat > ^RepeatManyTimesProxy target: target times: count > > RepeatManyTimesProxy>>doesNotUnderstand: aMessage > count <= 0 ifTrue: [^target]. > count := count - 1. > target := target perform: aMessage selector with: aMessage arguments. > ^self perform: aMessage selector with: aMessage arguments > Nicolas
