clines-from-file - The argument to CLINES, LINE, is not a string
- From: xbunny <xbunny@xxxxxxxxxxxxxx>
- Date: Sun, 30 Oct 2005 16:29:52 GMT
There is a great macro in ECL called Clines which allows me to paste C code into the ECL C output file and then other parts of ECL allow me to access and call that code once its compiled. What Im trying to do is write a function which allows me to read a file and puts its contents into Clines rather than having the C embedded as strings in the Lisp source. However I am a clueless newbie :-( I have the following function :
(defun clines-from-file (filename)
(with-open-file (stream filename :direction :input)
(loop for line = (read-line stream nil stream)
until (eql line stream) do
(Clines line))))which I would think does what I want, however it generates an error when I load the file. ECL says:
The argument to CLINES, LINE, is not a string.
which is confusing because it 'looks' like a string if I change (Clines line) to (print line).
Can anyone help? I have a feeling that clines-from-file needs to be a macro like Clines but Im still learning macros.
Best regards, Bunny
.
- Follow-Ups:
- Re: clines-from-file - The argument to CLINES, LINE, is not a string
- From: Johan Bockgård
- Re: clines-from-file - The argument to CLINES, LINE, is not a string
- From: Pascal Bourguignon
- Re: clines-from-file - The argument to CLINES, LINE, is not a string
- Prev by Date: Re: www.lispalien.com
- Next by Date: Re: Lispnik logo
- Previous by thread: www.lispalien.com
- Next by thread: Re: clines-from-file - The argument to CLINES, LINE, is not a string
- Index(es):
Relevant Pages
|