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

Re: [MacPerl] Re: Recognizing Unix Line Breaks



I hope we can start winding down the CR/LF debate again. It tends to flare up
every year and drag on and on. The parameters of the debate have not changed
since 1991:

 - I will not implement any proposal that requires people to change their code
   to get Mac newlines when writing Mac files.
 - I will not interfere with anyone implementing what he thinks is the right
   thing to do in MacPerl.

In private mail this morning, I got a proposal to implement '/' as a path
separator, do don't even *think* of bringing *that* proposal up again. It would
require significant climate changes in unpopular residential areas of the
afterlife before I implement that proposal, but I won't interfere with anyone
else implementing it.

haz1@nwu.edu (Bill Hazelrig) writes:
>Maybe what's needed is an I/O streams module which replaces the standard
>I/O semantics (as "use integer" does the standard arithmetic semantics).
>Give fopen() an extra parameter when the module is used-- a reference to a
>variable containing the line-break string to use; when opening a file for
>input, fopen() would set this variable (via the reference passed in the
>call to fopen).  Then, calls to <FILEHANDLE> and print FILEHANDLE ...
>could implicitly do s/$$LineBreakRef/\n/g and s/\n/$$LineBreakRef/g,
>respectively.

This is actually a proposal with some chances of succeeding. While I haven't
worked out all the details yet, perl5.004 optionally supports sfio instead of
stdio, and I intend to switch MacPerl over to sfio (I've had a Mac sfio port
available for some time). sfio supports the pushing of "filter functions" onto
standard I/O streams, and I vaguely remember that Perl supports, or could be
made to support, this functionality. If that works out, it will be easy to
support LFs, runes, barcode, or EBCDIC for a stream.

Matthias

-----
Matthias Neeracher   <neeri@iis.ee.ethz.ch>   http://www.iis.ee.ethz.ch/~neeri
      "Success is what me make of the mess we have made out of things"















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