() Andy Wingo <[EMAIL PROTECTED]> () Mon, 09 Jul 2007 12:57:41 +0200 (I would really like to be able to get line numbers so that the documentation that I autogenerate based on introspection can be ordered as it appears in the source. I poked at this a couple hours and failed.)
below is some code you can try. to play: save as x.scm and issue the shell command: guile -s x.scm. thi ________________________________________________________ (define (lc alist) (list (assq-ref alist 'line) (assq-ref alist 'column))) (define (posn form) (display "posn: ") (write (cond ((not (pair? form)) "not a pair") ((source-properties form) => lc) (else #f))) (newline)) (define p (open-input-file "x.scm")) (define (r) (read-enable 'positions) (let ((form (read p))) (or (eof-object? form) (begin (display "form: ") (write form) (newline) (posn form) (r))))) 42 (r) _______________________________________________ Guile-user mailing list Guile-user@gnu.org http://lists.gnu.org/mailman/listinfo/guile-user