[slime-devel] Small fix for swank-lispworks

Hi, The file swank-lispworks contains a function named dspec-file-position that, in recent LispWorks versions, reads forms from a file. The problem is that the file might contain #. forms that might refer to *compile-file-pathname* or *compile-file-truename*, or *load-pathname* or *load-truename*. In order to "emulate" the compilation or loading process, this function must also provide values to those variables so that the forms can be properly read. My quick fix is: (defun dspec-file-position (file dspec) (let ((*compile-file-pathname* (pathname file)) (*compile-file-truename* (truename file))) (let ((*load-pathname* *compile-file-pathname*) (*load-truename* *compile-file-truename*)) (with-open-file (stream file) (let ((pos #-(or lispworks4.1 lispworks4.2) (dspec-stream-position stream dspec))) (if pos (list :position (1+ pos) t) (dspec-buffer-position dspec 1))))))) Best regards, António Leitão.

Antonio Menezes Leitao <aml@gia.ist.utl.pt> writes:
Hi,
The file swank-lispworks contains a function named dspec-file-position that, in recent LispWorks versions, reads forms from a file.
applied. i didn't test it so make sure it works. -- -Marco Ring the bells that still can ring. Forget your perfect offering. There is a crack in everything. That's how the light gets in. -Leonard Cohen
participants (2)
-
Antonio Menezes Leitao
-
Marco Baringer