RE: [Fwd: Re: How to load files with Mac line ending?]

"James Anderson" <[email protected]> Fri, 19 Aug 2005 18:08:41 +0200
Newsgroups gmane.lisp.allegro
Message-ID <[email protected]>
yes, i agree, it does.

depending on runtime it may also fail to accommodate any format directive(s)
which depend on eol-encoding.

under most circumstances it will get the o.p. a lot further than reading entire
files as comments.

are other more portable mechanisms to alleviate this problem? i would be
grateful to hear them.

...

> -----Original Message-----
> From: Steve Haflich [mailto:[email protected]]
> Sent: Friday, August 19, 2005 17.58
> To: James Anderson
> Cc: [email protected]; Kevin Crosbie
> Subject: Re: [Fwd: Re: How to load files with Mac line ending?]
>
>
>    From: "James Anderson" <[email protected]>
>
>    this works;
>
>    (defun |universal-comment-reader| (stream char)
>      (declare (ignore char))
>      (loop (case (read-char stream nil nil)
>              ((#\return #\linefeed nil) (return))
>              (t )))
>      (values))
>
>    (set-macro-character #\; '|universal-comment-reader|)
>
> This approach fails if any other code makes a copy of the standard
> readtable with (copy-readtable nil).