[plt-scheme] Current line number

From: Jay McCarthy (jay.mccarthy at gmail.com)
Date: Mon Jan 18 16:03:44 EST 2010

You could do something like this:

#lang scheme
(define-syntax (current-line-number stx)
  (quasisyntax/loc stx
    '#,(syntax-line stx)))

(printf "~a: ~a~n" (current-line-number) 6)

(printf "~a: ~a~n" (current-line-number) 8)

On Mon, Jan 18, 2010 at 1:56 PM, Paulo J. Matos <pocmatos at gmail.com> wrote:
> Hi,
>
> I don't think there is such a thing but does plt provide a
> (current-line-number) that returns the line number where this is located
> (current-source-file) that returns the filename path
> ?
>
> If not, is it possible to implement it in Scheme?
>
> --
> Paulo Jorge Matos - pocmatos at gmail.com
> http://www.pmatos.net
> _________________________________________________
>  For list-related administrative tasks:
>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>



-- 
Jay McCarthy <jay at cs.byu.edu>
Assistant Professor / Brigham Young University
http://teammccarthy.org/jay

"The glory of God is Intelligence" - D&C 93


Posted on the users mailing list.