emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/geiser-racket ead1967 111/191: Racket: fix for module eval


From: Philip Kaludercic
Subject: [nongnu] elpa/geiser-racket ead1967 111/191: Racket: fix for module evaluation/entering
Date: Sun, 1 Aug 2021 18:32:10 -0400 (EDT)

branch: elpa/geiser-racket
commit ead19679995fba85e987c178e3f4dde85d3059db
Author: Jose Antonio Ortega Ruiz <jao@gnu.org>
Commit: Jose Antonio Ortega Ruiz <jao@gnu.org>

    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.
---
 geiser/enter.rkt | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/geiser/enter.rkt b/geiser/enter.rkt
index b2e233f..6da8c7a 100644
--- a/geiser/enter.rkt
+++ b/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))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]