El mar 10, 2015 8:13 AM, "Sean P. DeNigris" <s...@clipperadams.com>
escribió:
>
> Ben Coman wrote
> > Now the followup question is whether its natural to expect something
> > better from #asString
>
> I feel like #asString is such a general question that no answer would be
> satisfying. What string representation should be returned? 'file://'?
> '/path/to'? And what to do with memory file systems? It's been mentioned a
> few times on the list that we should all be more disciplined in sending
e.g.
> #displayString vs. #printString instead of #asString. The more I hear that
> argument, the more sense it makes to me.

I would remove #asString and use #displayString everywhere. But it should
be implemented in Object, based on a #displayOn: method just like
printString does.

If a method starts with #as... I read "I will cast this object into
something else". Which will be subject to taste.

Regarding this particular case I would implement #asString as a delegation
to the method that returns '/foo/bar/baz'. An URL's #asString would return
'file:///foo/bar/baz'.

Regards!

Reply via email to