On Friday 03 November 2006 06:32, Stephen Compall wrote: > J Pfersich wrote: > > For the Character, asString gives me the representation I'm looking for, > > whereas the Float only has printString available. Shouldn't there be > > a asString method available for Floats? > > No, and here's why. > > st> #($p $o $n $g) asString printNl! > 'pong' > st> #($p $o $n $g) printNl! > ($p $o $n $g ) > > In other words, the "printable representation" (what #printOn: puts on > its stream argument) isn't the same as "an equivalent object of class > String" (what #asString answers). > > Languages that rely on a single method convert-to-string protocol blur > this important distinction.
My brain very much appreciates blurring such things, as it helps concentrating on the problem, not the implementation ;) ^manveru _______________________________________________ help-smalltalk mailing list [email protected] http://lists.gnu.org/mailman/listinfo/help-smalltalk
