I'm playing around with SICP's Metacircular Scheme Evaluator, and thought it 
would be convenient to try and do that in a #lang setup in Racket, so I can use 
the Racket Definition Window and REPL. No Reader modification is needed, since 
Scheme code is already S-expressions. The expander just calls m-eval on each 
S-expression. This is my setup:

ME-test.rkt:

#lang s-exp "ME-expander.rkt"

(Scheme code ...)
---


ME-expander.rkt:

#lang racket/base

(require (for-syntax racket/base))

(define-syntax (ME-module-begin stx)
  (syntax-case stx ()
    [(_ s-expressions ...)
     #'(#%module-begin (for-each
                        (lambda (expr) (displayln (m-eval expr)))
                        (list 's-expressions ...)))]))

(provide (rename-out (ME-module-begin #%module-begin))
         #%top-interaction)

(define (m-eval ... ; from here on the SICP Evaluator
---

This works fine in the ME-test.rkt Definition window, but not in the REPL which 
doesn't have bindings for anything. I would like anything typed into the 
ME-test.rkt REPL to be used as argument to the ME-module-begin macro in 
ME-expander.rkt.

When searching for this I found descriptions of REPL setups in a more complete 
#lang setup which I don't understand yet. Is it possible to make the REPL work 
in the setup above? Any other comments are also welcome.

Many thanks in advance, Jan

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to