[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] When is \r really \n in MacPerl!?



According to Jon Warbrick:
> 
> On  9 Feb 98 at 17:22, "Mark F. Murphy" <markm@mail.tyrell.com> 
> wrote:    
<snip>
> > Ord \r: 10
> > Ord \n: 13
> 
> Out of interest, if you believe \n to be well defined than what would 
<snip>

Out of wanting to help halt this thread I give you my
version of where this all came from and went to.  :-)

Back in the prehistoric days of my youth, we used things
called typewriters.  Not electric typewriters - but
typewriters.  Typewriters had this little bar which stuck
out to the side known as the thing-a-ma-bob which you'd
slam your hand into and push to the right as hard as you
could in an attempt to be able to type faster and make a
better grade in typing class.  Like it's later cousin the
electric typewriter and teletype sometimes you'd get it to
go all the way back to the right and some times you
wouldn't.  But you could be sure your hand would get pretty
sore after a while.

When electric typewriters came along, they attempted to
emulate the left-right motion of the original typewriters.
Unfortunately, many people's hands hurt a lot more after
attempting to slam the cartridge back over on electric
typewriters.  Myself included.  Then came the teletypes.
With a teletype the print head moved back and forth and the
cartridge only rotated up and down.  People began banging
on the sides of the teletypes to make them work right.
This only caused random characters to appear every now and
then and didn't help the thing to work as all it seemed to
do was to rattle the teletype's brains a bit.

However, the powers that be had to come up with some sort
of a standard whereby all electric typewriters and
teletypes would operate in the same manner.  So the
beginnings of the ascii standard was born.  Control-@
became the NULL command which was used to make the computer
wait long enough for the teletypes and electric typewriters
to do whatever it was they were doing.  Control-M became
the carriage return command which eventually turned into
\r.  Control-J became the line feed command and eventually
the \n.  Unfortunately, everyone had their own idea about
how many of each thing was needed in order to correctly get
a teletype or typewriter to actually do the actions.

Then came CRTs and everything became even more confusing.
"Why," some asked, "do we even need a return if we are
going to do a line feed?"  Others asked why the need for a
line feed if we are doing a return.  After all, these
people argued, if the cursor is returned to the left hand
side of the screen shouldn't it pop down a line afterwards
automatically?

And so there were more meetings and more changes and
finally it was settled on what Matthias has already
posted.  Somewhat.  You see, it turns out that different
computer languages have different ideas on how to implement
what was agreed upon by everyone.  Which is why even
languages on different computers are created differently.
At least things are getting somewhat better though.  At
least all of the computers can more or less communicate
with each other now.  Before it was a hassle to even move a
file from one computer to another.  Now at least we can do
that with relative ease.  But it will probably take another
ten to twenty years before all of the computers out there
will accept another computer's binary programs and execute
them without a problem.

Meanwhile you have some simple choices:  You can live with
it, deal it, or throw your hands up in the air and stop
trying to work with computers.

Me, I just deal with it.  After all, it takes twice as long
to rant and rave over why things shouldn't be this way than
it does to just write the lines of code needed in order to
deal with the problem.

Just my $0.02 worth.

***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch