[racket] querying for compile-time information

From: Danny Yoo (dyoo at cs.wpi.edu)
Date: Thu Sep 9 16:56:24 EDT 2010

I'm trying to figure out how to query a module for compile-time
information.  I've got some toy code here:

     http://github.com/dyoo/permissions

Basically, I want to annotate a module with permissions that the
module requires.  I'm defining a permission to be a literal string for
the moment.  I want to have a way of querying a module, later on, for
those permissions.  For example, the open-image-url.rkt module here:

    http://github.com/dyoo/permissions/blob/master/t/open-image-url.rkt

says that it requires network access.  I'd like to have my query module:

    http://github.com/dyoo/permissions/blob/master/query.rkt

be able to grab the set of permissions that a module says that it needs.

Doing this at runtime is something I know how to accomplish, by having
my require-permission macro introduce a 'permissions binding.
However, I don't want to do it that way: I want to grab this
information without evaluating the run-time portion of a module.


I started hacking at this on my compile-time branch
(http://github.com/dyoo/permissions/tree/compile-time) but I'm getting
stuck.  In particular, I don't quite know how to get my query.rkt
module to communicate with the record.rkt module.  Can someone give
pointers on what I should be looking at?


Posted on the users mailing list.