[racket] using syntax/modcode and make-base-namespace

From: Danny Yoo (dyoo at cs.wpi.edu)
Date: Fri May 20 11:45:53 EDT 2011

I'm using syntax/modcode, and am running across an error that I don't
understand yet.  Here's test code to demonstrate:

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
#lang racket

(require syntax/modcode)

(define collects-dir
  (normalize-path
   (let ([p (find-system-path 'collects-dir)])
     (cond
       [(relative-path? p)
        (find-executable-path (find-system-path 'exec-file)
                              (find-system-path 'collects-dir))]
       [else
        p]))))

(void
 (parameterize ([current-namespace (make-base-namespace)])
   (get-module-code (build-path collects-dir "htdp" "tests"
"matrix-client.rkt"))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


I see the following error:

##########################################################################
read-syntax: cannot load snip-class reader: #"(lib \"matrix.ss\" \"htdp\")"

 === context ===
/research/plt/software/racket/5.1.1/std/collects/wxme/wxme.rkt:382:2: find-class
/research/plt/software/racket/5.1.1/std/collects/wxme/wxme.rkt:208:2: read-snip
/research/plt/software/racket/5.1.1/std/collects/wxme/wxme.rkt:617:4: read-proc
/research/plt/software/racket/5.1.1/std/collects/mzlib/port.rkt:167:4:
do-read-it
/research/plt/software/racket/5.1.1/std/collects/lang/htdp-reader.rkt:13:4: loop
/research/plt/software/racket/5.1.1/std/collects/lang/htdp-reader.rkt:13:4: loop
/research/plt/software/racket/5.1.1/std/collects/wxme/wxme.rkt:695:2:
wxme-read-syntax
/research/plt/software/racket/5.1.1/std/collects/syntax/modcode.rkt:47:8
/research/plt/software/racket/5.1.1/std/collects/syntax/modcode.rkt:79:2: core
##########################################################################


Am I misusing it?


Posted on the users mailing list.