[ENH] Proposal to drop contentsOfEntireFile

Dan Ingalls Dan.Ingalls at disney.com
Fri Jun 2 05:39:03 UTC 2000


Andres Valloud <avalloud at exobox.com> wrote...
>Problem: there's contents in ReadWriteStream, but it doesn't work in
>FileStream because some variables are constantly nil in FileStream. But
>FileStream provides contentsOfEntireFile to solve the problem.
>
>What do I think about it: polymorphism is broken.
>
>Proposed solution: rename the method contentsOfEntireFile in FileStream
>to contents, and fix its 48 senders.
>
>I can do this in a while. But... do you think it's ok?

I can't say for sure without a bit more investigation, but I think I remember some of the history.  An earlier (and in some ways better ;-) implementation of the Smalltalk file system worked by having fileStreams inherit from normal streams, but with a different implementation for, eg, pastEnd and pastEndPut: to handle the situation when you run past the end of the current buffer.  I think there were cases where one wanted the normal operation of #contents (eg, to fetch all remaining in the current buffer) as well as #contentsOfEntireFile.

I think I agree with your desire for uniformity.  I'm not sure this is the best time to change 48 methods to bring this about.  How about when we are into 2.9alpha?

	- Dan






More information about the Squeak-dev mailing list