[plt-scheme] Running mzc with DrScheme-compatible error-tracing stuff?

From: Danny Yoo (dyoo at cs.wpi.edu)
Date: Thu Feb 14 12:57:26 EST 2008

I notice that the error tracebacks I get from code compiled with plain mzc 
aren't as informative as if I had led DrScheme to do the compilation 
itself.

Is there anything I can do so mzc also adds the annotations that 
DrScheme's runtime expects?


I tried to do something with the errortrace library, but it didn't look 
like DrScheme was using the resulting files.  Perhaps I'm misusing 
errortrace/zo-compile?  Here's the code I've tried so far:

######################################################################

#lang scheme/base

;; make - compile all files in my project path into
;; errortraced zos for faster loading

(require errortrace
          errortrace/zo-compile
          scheme/runtime-path
          scheme/file
          compiler/compiler
          (for-syntax scheme/base))


(provide make clean)

(define self-path (path->string (build-path (current-directory) 
"make.ss")))
(define source-files (find-files (lambda (a-path)
                                    (and (regexp-match #rx".ss$"
                                                       (path->bytes 
a-path))
                                         #t))
                                  (let-values ([(base name must-be-dir?)
                                                (split-path self-path)])
                                    base)))

(define (clean)
   (for ([file
          (find-files (lambda (a-path)
                        (and (regexp-match #rx".zo$"
                                           (path->bytes a-path))
                             #t))
                      (let-values ([(base name must-be-dir?)
                                    (split-path self-path)])
                        base))])
     (delete-file file)))

(define (make)
   (parameterize ([current-compile zo-compile])
     ((compile-zos #f) source-files 'auto)))



Posted on the users mailing list.