[racket] Language Toolkit Questions

From: Pavel Panchekha (pavpanchekha at gmail.com)
Date: Tue Jul 19 19:08:09 EDT 2011

I'm trying to port some code from MIT Scheme to Racket.  A large part of
the MIT Scheme was a metacircular interpreter, and I'm hoping that I can
use Racket's language definition capabilities to avoid that annoyance.

But I've hit a snag.  One of the important parts of the MIT Scheme
wrapped all objects in another structure.  It then distinguished between
primitive functions, for which we would have to unwrap that structure
and use a fallback, and functions defined in the guest Scheme, which
expected wrapped objects and so we could use a smarter apply function.

In Racket, I can override =%datum=, =lambda=, and similar, to produce
these wrapped objects.  But I can't figure out what to do with =%app=.
If there was some primitive for "defined outside this language", I could
use that.  Or if there was a way of explicitly "tagging" objects (some
sort of transparent metadata, as has e.g. Clojure), I could tag all of
my non-primitive functions and use that.

Do you know if anything like either of these options exist?  Or is there
some clearer way in Racket to express what I want to do?

 Pavel Panchekha

Posted on the users mailing list.