[Ecls-list] Runtime bug in compiled code
Pascal J. Bourguignon
pjb at informatimago.com
Thu Jan 1 14:46:37 UTC 2015
> On 01 Jan 2015, at 14:33, <daiyanh at yahoo.co.jp <mailto:daiyanh at yahoo.co.jp>> <daiyanh at yahoo.co.jp <mailto:daiyanh at yahoo.co.jp>> wrote:
>
> Another example from http://www.cliki.net/diff <http://www.cliki.net/diff>
> In the diff.lisp file,
>
> (defmacro do-file-lines ((line-var pathname-var &optional result) &body body)
> (let ((stream-var (gensym)))
> `(with-open-file (,stream-var ,pathname-var :direction :input
> :element-type 'character)
> (do-stream-lines (,line-var ,stream-var ,result)
> , at body))))
>
> (defun diff::intern-files (&rest files)
> (let ((interner (diff::make-interner))
> (interned-files nil))
> (dolist (file files (values interner (nreverse interned-files)))
> (let ((interned-file nil))
> (diff::do-file-lines (line file)
> (let ((code (diff::intern-string interner line)))
> (push code interned-file)))
> (push (coerce (nreverse interned-file) 'simple-vector) interned-files)))))
>
> The compiled code refuses to run, presumably choking at the macro expansion above.
> If I eval the lower diff::intern-files by c-x c-e, the code runs fine.
Works for me:
; SLIME 2014-08-01
CL-USER> (ql:quickload :diff)
To load "diff":
Load 1 ASDF system:
diff
; Loading "diff"
[package cl-ppcre]................................
[package impl-specific-gray]......................
[package trivial-gray-streams]....................
[package diff]......
(:DIFF)
CL-USER> (diff::intern-files #P"/tmp/a/a.lisp" #P"/tmp/a/b.lisp")
#<a DIFF::INTERNER>
(#(0 1 2 3 4 5 6 7) #(0 8 2 9 4 10 6 11))
CL-USER> (list (lisp-implementation-type) (lisp-implementation-version))
("ECL" "13.5.1")
CL-USER>
http://www.centova.com/en/faq/general/troubleshooting/how_to_effectively_report_a_bug_or_problem <http://www.centova.com/en/faq/general/troubleshooting/how_to_effectively_report_a_bug_or_problem>
--
__Pascal J. Bourguignon__
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/ecl-devel/attachments/20150101/d60f59d5/attachment.html>
More information about the ecl-devel
mailing list