Abdulaziz Ghuloum <[email protected]> writes:
> On Sep 9, 2009, at 9:56 PM, Eduardo Cavazos wrote: > >> Hello, >> >> You can change what module "you're in" with the Guile REPL and this >> is reflected at the prompt. >> >> What would this mean in an R6RS context? > > This can mean one of many possible things. The two most obvious > answers are: > > 1. Start a repl in an environment that's the result of importing (foo). > 2. Start a repl in the environment after the definitions inside the > library (foo). In both Guile and MzScheme, the meaning is to enter the module's namespace, meaning that all identifiers bound inside the module (not just the exported ones) are in scope. Meaning also that one can add new bindings and lexical keywords to the namespace, or modify existing ones. In the latter case, when the identifier is a exported one, the new definition is visible to the library users, either immediately for regular variables or after re-evaluation of the affected code for macros. Geiser takes full advantage of these capabilities (which i happen to like a lot), and has the concept of current namespace, which defines the environment of evaluations sent to the underlying scheme. When you're in the REPL, the current namespace is the last you entered (using enter! in PLT or an equivalent mechanism in Guile). When you're editing scheme code, the current namespace is defined by the module the current file belongs to; when you send code to be evaluated, geiser enters the namespace, evaluates the code and sends back the result after returning to the previous namespace. This provides a well-defined context for all geiser commands (for instance, when you ask for completions you only get identifiers visible in the module at hand). One can also, of course, evaluate any form in the current namespace, not just definitions. Of course, i'll left it to you to decide whether this is a desirable behaviour, but, as a geiser developer and one of those persons that is much happier when hacking in that kind of dynamic environments, i'd be very pleased if we could have it for ikarus libraries. If that's not possible, we'll have to come up with a new semantics for geiser's evaluation commands in their ikarus incarnation. > Both of these are already possible and were discussed here some time > ago. Do you mean 'possible' as in implementable or as in already in there? Cheers, jao -- Lisp has assisted a number of our most gifted fellow humans in thinking previously impossible thoughts. —Edsger Dijkstra
