CrLfFileStream as default?

R. A. Harmon harmonra at webname.com
Fri Sep 25 14:36:01 UTC 1998


At 07:11 PM 9/24/98 -0500, Dwight Hughes wrote:
>I would also like to see it handle pathological files -- I seem to run
>into a number of source files that have (for example) LF in one part, CR
>in another, CRLF in another, and, just for fun, mutants like LFCRLF,
>CRLFLF, CRLFCR, and CRCRLF sprinkled here and there. Perhaps
>CrLfFileStream should simply chomp all of the above combinations into a
>single CR on a read (which seems to be the "right thing" in most cases
>I've seen), and only bother with line end conventions when filing out.
>
>I guess I'm wondering if this would be useful to others or if I'm just
>lucky.
[snip]

Because I was using Text objects extensively, a month or so back I installed
and used CrLfFileStream and had the same experience with pathological files.
I spent some time trying change it to produce a carriage return for line
termination internally from any line termination combinations read, and a
platform dependent line termination externally.  I kept running into small
difficulties such as style run arrays base on the string length breaking,
the position question, and others.  The fixes were multiplying exponentially
it seemed.

I look at the problem from the prospective of the entire Stream hierarchy,
but noticed that the hierarchy seemed to have grow incrementally with out an
over-arching partition of responsibility and behavior, mostly due to no
ExternalStream class.  This was turning into a large project that I didn't
want to deal with in the middle of the ANSI stuff project.  So I set it
aside for later as one of 5,678 other projects.

I think it would be worth while to discuss if we were to rewrite Squeak from
scratch and add the functionality of the current Stream hierarchy, what
would the new Stream hierarchy be.  I think it would be especially important
for those who authored major pieces to contribute their design tradeoffs and
where they think they pieces would fit.  I think this would allow a graceful
migration of behavior to the appropriate class, and reduce some of the
duplication, anomalies and inconsistencies.

I would be very interested in an analysis of the current Stream structure
and the process of designing a new one.  I have been trying for about a year
now to move up process from coding to design and analysis, but it's been a
lot of the "When you're up to your ass in alligators, it's hard to remember
your purpose was to drain the swamp" syndrome.  I also wondered if any
college CS departments gave a course that took a group of students that have
completed the design and analysis courses, and dropped them into an existing
real application with all its legacy problems to design a major enhancement.
The analysis of the current Squeak Stream hierarchy might prove to be a
useful project for some instructor to assign his design and analysis class.

I took this course in the school of hard knocks as a programmer on
mainframes who was asked to design a new application system.  I had no clue
how to do it.  I think a lot of folks learned design by doing it when
promoted to System Analyst from Programmer.  If you were successful, you
were promoted to something else.  If you failed, you did another design.  



--
Richard A. Harmon          "The only good zombie is a dead zombie"
harmonra at webname.com           E. G. McCarthy





More information about the Squeak-dev mailing list