[racket] eval in a module language

From: Joop Ringelberg (joop.ringelberg at gmail.com)
Date: Thu May 31 15:36:55 EDT 2012

Hello all,

I write a program in Racket that I subsequently compile with Bigloo. So I
restrict myself to forms and functions known to Bigloo. In order to ease
the transition between the two, I've created a module language that
recognizes (a subset of) Bigloo module statements. This works well enough:
in Racket, the Bigloo modules are converted to plain racket modules and
Bigloo recognizes its modules, too.

However, I run into a problem with eval.

When I use the following sequence in such a module:

(define-namespace-anchor a)
(define ns (namespace-anchor->namespace a))
(eval (x 1) ns)

I get the message:
procedure application: expected procedure, given: #<void>;

The same example would work in a context where racket is used (no error
messages).

This is part of the module language file:

(define-syntax-rule (module-begin (module moduleName clause ...) stmt ...)
  (#%module-begin
   clause ...
   stmt ...))

The above three expressions would wind up in the stmt's.
I think that the namespace anchor is not defined in the right phase.
However, I don't know how to change that. But maybe I am wrong.

Any suggestions?

Thanks in advance,

Joop Ringelberg
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20120531/b22c8b49/attachment-0001.html>

Posted on the users mailing list.