Committed. I also modified the other classes that implemented #asResponse. Thanks again :)
Cheers! Nico Le dimanche 21 juin 2009 à 16:27 +0200, Stefan Schmiedl a écrit : > While looking around in Iliad source code, I noticed that > Object>>asResponse is implemented using Object>>printString. > > Dolphin Smalltalk makes a -- quite useful -- distinction > between > > printString - what the developer wants to see > displayString - what the user gets to see > > Since we're living in a console based environment, I guess > that printString gets exercised quite a lot there. > > So here's my question: How about > > Object extend [ > asResponse [ > <category: 'converting'> > ^Iliad.Response ok > nextPutAll: self displayString; > yourself > ] > ] > > Also, I'm seeing that Iliad.Response supports the "usual" > streaming methods #nextPut: and #nextPutAll. What about > > Object extend [ > asResponse [ > | response | > <category: 'converting'> > response := Iliad.Response ok. > self respondOn: response. > ^response > ] > respondOn: aResponse [ > <category: 'responding'> > self displayOn: aResponse. > ] > ] > > I think that this approach could avoid (repeatedly) building > and printing strings. And it would offer a non-intrusive > new method #respondOn: to override in subclasses. So I could > eat my cake and keep it, too: > printOn: for console work, > displayOn: for (possibly embedded) content representation, > respondOn: for responding the object > > Note that I'm just venting hot air, as I have yet to write > my first line of Iliad-related code .-) > > s. > > > _______________________________________________ > help-smalltalk mailing list > [email protected] > http://lists.gnu.org/mailman/listinfo/help-smalltalk
signature.asc
Description: Ceci est une partie de message numériquement signée
_______________________________________________ help-smalltalk mailing list [email protected] http://lists.gnu.org/mailman/listinfo/help-smalltalk
