Page 1 of 1

need help on Clozure CL/Emacs on Vista

Posted: Wed Jul 01, 2009 8:31 pm
by Maxxum
I have been using Macintosh Common Lisp (MCL) for several years. Now I am switching to Clozure CL/Emacs on Windows Vista.

The first problem is I cannot load/compile my files successively. I use (load (compile-file "....")).
* Every .lisp file is "complied" to *.wx64fsl. But every wx64fsl file has size 1KB. I doubt my lisp files are actually compiled.
* When I tried to call some functions in my files, all I get is "undefined function".
* When I enter SLIME, select a function and "compile region", I can successively compile this function.

I am still in the very first stage of this system switch. Very frustrating....I will be very grateful if anyone can provide any tips.

Thanks a lot!!!!!

Re: need help on Clozure CL/Emacs on Vista

Posted: Thu Jul 02, 2009 1:15 pm
by nuntius
A couple questions:
- What happens if you run CCL from the MSWin command line ("Run Program" "cmd")?
- Does (compile-file filename) print any errors or warnings?

Re: need help on Clozure CL/Emacs on Vista

Posted: Thu Jul 02, 2009 2:51 pm
by Maxxum
It turns out my source code is in MAC format. Clozure on Vista reads unix format by default. But when compiling code in mac format, it does NOT return any error and still generate
object files. Although the size of these dummy object file is very small (< 1KB), it took me a long time to realize that my code has not been successively compiled.

I (compile-file "...." :external-format :macos) and my code is finally successively compiled.

New trouble:

When I run my program, it reads some control file. But my program breaks because the control file cannot be opened or read (not sure)?

This is the input stream when break happens #<BASIC-FILE-CHARACTER-INPUT-STREAM ("D:/CONTROL/control-file.66"/1828 ISO-8859-1) #x141EFE57D>

What is "/1828 ISO-8859-1"? The file path is correct.

Thank you!
nuntius wrote:A couple questions:
- What happens if you run CCL from the MSWin command line ("Run Program" "cmd")?
- Does (compile-file filename) print any errors or warnings?

Re: need help on Clozure CL/Emacs on Vista

Posted: Thu Jul 02, 2009 6:29 pm
by gugamilare
Maxxum wrote:What is "/1828 ISO-8859-1"? The file path is correct.
I don't know about the /1828, but ISO-8859-1 is a codification standard (like utf-8 / unicode) which is the one used by windows (at least here, in Brazil).

Re: need help on Clozure CL/Emacs on Vista

Posted: Thu Jul 02, 2009 7:44 pm
by nuntius
This stream encoding stuff is getting out of my league wrt CCL. You should probably seek help on openmcl-devel or their IRC channel.
http://trac.clozure.com/openmcl#Support

Re: need help on Clozure CL/Emacs on Vista

Posted: Fri Jul 03, 2009 5:33 am
by blandest
Why don't you just save a copy of the source code and convert these files to the some "good" encoding for Windows ?
I did something similar using this function (works in ccl):

Code: Select all

(defun convert-file-encoding (file-encoding target-encoding file)
  "Converts `file' from `file-encoding' to `target-encoding'"
  (with-open-file (in file
                      :external-format file-encoding
                      :element-type 'character)
    (with-open-file (out (string-downcase
                          (format nil "~A.~A" file target-encoding))
                         :direction :output
                         :external-format target-encoding
                         :if-exists :supersede)
      (loop for line = (read-line in nil)
            while line
            do (princ line out))))
  (values))
You can use #'ccl:describe-character-encodings to list available encodings.

Re: need help on Clozure CL/Emacs on Vista

Posted: Sat Jul 11, 2009 2:47 pm
by Wodin
Maxxum wrote:When I run my program, it reads some control file. But my program breaks because the control file cannot be opened or read (not sure)?

This is the input stream when break happens #<BASIC-FILE-CHARACTER-INPUT-STREAM ("D:/CONTROL/control-file.66"/1828 ISO-8859-1) #x141EFE57D>

What is "/1828 ISO-8859-1"? The file path is correct.
It looks like it's trying to interpret your control file using the ISO-8859-1 (a.k.a. latin1) character encoding. Maybe your file is not encoded in ISO-8859-1. e.g. it might be in Mac OS Roman encoding or something else.