diff options
author | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2012-10-28 01:38:17 +0200 |
---|---|---|
committer | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2012-10-28 01:38:17 +0200 |
commit | f5144a27494a1e83d658d400289ba104b050ffd3 (patch) | |
tree | 423b40a4d2fb1e4edf4c84e1de661575e2b9df38 /scheme/racket/geiser/enter.rkt | |
parent | 8bf3f70f6aba159461612be8577bd4193ee7c6e6 (diff) | |
download | geiser-guile-f5144a27494a1e83d658d400289ba104b050ffd3.tar.gz geiser-guile-f5144a27494a1e83d658d400289ba104b050ffd3.tar.bz2 |
Racket: fix for module evaluation/entering
Our module loader is receiving load requests for module names
represented as lists that are not exactly a submodule, in the sense
that the path does not represent an actual file.
This phenomenon happens for instance when specifying a reader in a
#lang tag. E.g.
#lang at-exp racket
will cause the loader to be called with module name '(main reader) and
path <cols-path>/at-exp/main.rkt, where main.rkt does not exist.
Afterwards, we see a call to load at-exp/lang/reader/rkt, with name
reader, which is the real code.
So, for now, i'm skipping all load requests with a list name,
forwarding them to racket's default loader.
Diffstat (limited to 'scheme/racket/geiser/enter.rkt')
-rw-r--r-- | scheme/racket/geiser/enter.rkt | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/scheme/racket/geiser/enter.rkt b/scheme/racket/geiser/enter.rkt index b2e233f..6da8c7a 100644 --- a/scheme/racket/geiser/enter.rkt +++ b/scheme/racket/geiser/enter.rkt @@ -39,10 +39,6 @@ (define (module-loader orig) (enter-load/use-compiled orig #f)) -(define (notify re? path) - (when re? - (fprintf (current-error-port) " [re-loading ~a]\n" path))) - (define inhibit-eval (make-parameter #f)) (define (get-namespace mod) @@ -85,10 +81,14 @@ (let ([cmps (explode-path path)]) (find (car cmps) (cdr cmps)))) +(define (notify re? path) + (when re? (fprintf (current-error-port) " [re-loading ~a]\n" path))) + (define ((enter-load/use-compiled orig re?) path name) (when (inhibit-eval) (raise (make-exn:fail "namespace not found" (current-continuation-marks)))) - (if (and name (or (not (list? name)) (car name))) ;; submodule names are lists + ;; (printf "Loading ~s: ~s~%" name path) + (if (and name (not (list? name))) ;; Module load: (let* ([code (get-module-code path "compiled" @@ -106,7 +106,6 @@ ;; Not a module: (begin (notify re? path) (orig path name)))) - (define (get-timestamp path) (let ([ts (file-or-directory-modify-seconds path #f (lambda () #f))]) (if ts @@ -121,6 +120,8 @@ (values -inf.0 path))) (values -inf.0 path))))) +(define orig (current-load/use-compiled)) + (define (check-latest mod) (define mpi (module-path-index-join mod #f)) (define done (make-hash)) |