[cmucl-imp] Compiling files with traditional Mac EOL in CMUCL

Raymond Toy toy.raymond at gmail.com
Wed Sep 6 14:40:56 UTC 2017


>>>>> "Chun" == Chun Tian <(binghe)" <binghe.lisp at gmail.com>> writes:

    Chun> OK, sorry, I carefully checked again. SBCL also doesn't support compiling
    Chun> files with Mac EOLs.  Clozure CL, which I confirmed now, indeed support Mac
    Chun> EOLs.

    Chun> For the reason I can't convert the source files to UNIX line endings,
    Chun> there's a Lisp function for parsing (multi-line) literal strings defined in
    Chun> source files with MAC line endings.  It seems that, #\Newline was mapped to
    Chun> "\r" in MCL, thus Lisp forms like (position #\Newline string) doesn't work
    Chun> in MCL for other line endings, especially the UNIX endings, because in this
    Chun> case there would be no #\Newline in the string at all!

I haven't tried this out in a long time, but maybe something like this
will work:

(compile-file "foo.lisp" :external-format '(:utf8 :cr))

This says to read the file using utf8 with a composing format of :cr
which converts CR to/from #\newline.

(I think I got the syntax right).

Let us know if this works.

--
Ray



More information about the cmucl-imp mailing list