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.

-- 
Stephen Compall
http://scompall.nocandysw.com/blog


_______________________________________________
help-smalltalk mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-smalltalk

Reply via email to