[plt-scheme] Re: managed-compile-zo

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Fri Jan 28 12:04:34 EST 2005

If I reduce your code to just

(module user mzscheme

  (require-for-syntax (lib "class.ss"))
  (define-syntax (warn stx)
    (syntax-case stx ()
      [(_ src msg)
       #`(printf #,(string-append
		    "~a ("
		    (format "~a"
			    (let ([src (syntax-source stx)]
				  [src-module (syntax-source-module stx)])
			       [(symbol? src-module) src-module]
			       ;;[(module-path-index? src-module)
			       ;; (let-values ([(path base) 
                               ;;      (module-path-index-split src-module)])
			       ;;   (list path base))]
			       ;;[(is-a? src text%) "some text"]
			       [(string? src) src]
			       [src (send src get-position)]
			       [else src])))
		    " line "
		    (number->string (syntax-line stx))
		    "): ~a~n")
                 src msg)]))
  (warn 'foo "barrr")
  (provide warn)

then it still fails with "cm.ss", and it doesn't even work with `load'
in MzScheme. The problem is that a syntax object's source can be a
path. (In fact, it's usually a path.)


Posted on the users mailing list.