On Sep 6, 2009, at 10:51 AM, Brian Mastenbrook wrote:

> * To aid in meta-programming at the REPL, the top-level environment
> previously created at the REPL can be assigned a name and be made
> available as a library for import at this point. In an implicitly-
> phased implementation, the bindings are available directly. A  
> separate-
> instantiation implementation must record the top-level forms entered
> at the REPL for future instantiations of the library.

In the example, I showed how a separate-instantiation implementation  
would re-instantiate the previous top-level-program-as-library when  
entering a new top-level program which imports the previous top-level  
program. After thinking about this for a minute, I believe it would be  
desirable for even a separate-instantiation implementation to avoid  
this behavior *if* only one instantiation is required. For example:

 > #!r6rs
(import (rnrs base (6))
         (rnrs io simple (6))) ; I also missed this in my previous  
example
 > (define a (begin (display "hi") (lambda (stx) 42)))
OUTPUT: hi
 > #!r6rs
(import (rnrs base (6))
         (for (top-level 0 ()) (meta 1)))
; This need not re-instantiate the previous top-level program as only  
instantiation is necessary, and it has already been constructed. But:
 > #!r6rs
(import (rnrs base (6))
         (top-level 0 ())
         (for (top-level 0 ()) (meta 1)))
OUTPUT: hi
; One additional instantiation is necessary in this case.


--
Brian Mastenbrook
[email protected]
http://brian.mastenbrook.net/


_______________________________________________
r6rs-discuss mailing list
[email protected]
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss

Reply via email to