[plt-scheme] Including example code from a file in Scribble

Matthew Flatt mflatt at cs.utah.edu
Sun Aug 5 11:27:46 EDT 2007


At Sun, 5 Aug 2007 15:57:16 +0100, "Noel Welsh" wrote:
>                (with-input-from-file file-name
>                  (lambda ()
>                    (port->list
>                     (lambda (p) (read-syntax file-name p))
>                     (current-input-port))))])

Add 

 (port-count-lines! (current-input-port))

before the `port->list' call.


Having to explicitly turn on line counting is common source of
confusion, but I don't have a good idea on how to avoid it, mainly
because PLT Scheme doesn't distinguish text ports from binary ports.

Matthew




More information about the plt-scheme mailing list