-
-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
R7RS import
and environment of load
#77
Comments
b.scm isn't a proper R7RS program, so isn't interpreted as R7RS. Add What's happening is that |
Yes, My reasoning regarding
Using Example:
Using plain Gauche REPL:
I'm slowly getting rid of R7RSisms in my code, because I want it to work on implementations that are not nearly R7RS yet (like Guile) and others that will never be (Racket), but I wanted to mention Gauche's behaviour here because I found it surprising and may not be intended to work like that. |
Currently With r7rs.user environment, it's certainly confusing |
Ok, this cleared things a bit for me, thanks for explaining! Switching from |
Beware |
Yes, saw that on the documentation, but it is fine for my use-case.
It looks roughly like this: ;; The code here is part of the "(shen primitives)" module
(define *shen-environment* #f)
(define (set-shen-environment! env)
(set! *shen-environment* env))
(define (eval-in-shen expr)
(eval expr *shen-environment*))
(define (kl:eval-kl expr)
(eval-in-shen (kl->scheme expr))) And on init: ;; This is the initialisation file
;; <imports and defines>
;; ...
;; set the environment
(set-shen-environment! (current-module))
;; Start the shen repl
(kl:shen.shen) |
Using Gauche from git (5ac6b1d from Jul 3)
When using R7RS
import
, callingload
evaluates the code in a different environment that doesn't include the imported identifiers, but it works fine with Gauche'suse
:a.scm:
b.scm:
With Gauche's
use
:With R7RS's
import
:The text was updated successfully, but these errors were encountered: