cm <xiao.ao.jiang.hu...@gmail.com> writes:

> I write a hello.lisp file like this:
> (print "hi")
> (length '(a . b 1))
>
> and I load it in to ecl:
>> (load "code/hello.lisp")
>
> ;;; Loading "D:/ECL/code/hello.lisp"
>
> "hi"
> Condition of type: SIMPLE-READER-ERROR
> Reader error in file #<input stream #P"D:/ECL/code/hello.lisp">, position 30:
> Too many objects after a list dot
>
> Available restarts:
>
> 1. (RESTART-TOPLEVEL) Go back to Top-Level REPL.
>
> Broken at SI:BYTECODES. [Evaluation of: (LOAD "code/hello.lisp")] In: 
> #<process
> TOP-LEVEL>.
>
> It has not line number in error message but postion 30.
> I found it is the position of characters.  how to get the line number
> of code from error message?

Like this:

(ql:quickload :com.informatimago.common-lisp.lisp-text)
(use-package :com.informatimago.common-lisp.lisp-text.source-text)

(position 30 (:build-line-index "/tmp/hello.lisp") :test (function <))
--> 2


-- 
__Pascal Bourguignon__                     http://www.informatimago.com/
A bad day in () is better than a good day in {}.

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Ecls-list mailing list
Ecls-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ecls-list

Reply via email to