[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.lisp

SBCL load ignores file after comments

sslade

10/25/2015 8:15:00 PM

I am running SBCL 1.2.8-1.el7,

The file test.lisp contains the following:


(in-package common-lisp-user)
(defvar x)

;; comment

(setf x 10)
(format t "~%This is a test. X = ~D~%" x)




When I try to load it, load ignores everything after the comment.


* (load "test.lisp")

; loading #P"/home/classes/cs458/lisp/test.lisp"
; #<PACKAGE "COMMON-LISP-USER">
; X
T


If I remove the comment, no problem:


* (load "test.lisp")

; loading #P"/home/classes/cs458/lisp/test.lisp"
; #<PACKAGE "COMMON-LISP-USER">
; X
; 10

This is a test. X = 10
; NIL
T


Please advise.

--Stephen
1 Answer

Pascal J. Bourguignon

10/25/2015 8:43:00 PM

0

sslade@gmail.com writes:

> I am running SBCL 1.2.8-1.el7,
>
> The file test.lisp contains the following:
> When I try to load it, load ignores everything after the comment.
> If I remove the comment, no problem:
> Please advise.

Ok. I'll engage my telepathic debugging abilities, and say that your
file contains CR instead of LF, and that sbcl considers that it's on a
single line.

Try: (with-open-file (src "test.lisp") (read-line src))
and see what it returns.

--
__Pascal Bourguignon__ http://www.informat...
â??The factory of the future will have only two employees, a man and a
dog. The man will be there to feed the dog. The dog will be there to
keep the man from touching the equipment.� -- Carl Bass CEO Autodesk