[racket] tool: show module exports
On 07/21/2010 05:26 AM, Robby Findler wrote:
> One, non-optimal way to get the contracts is to evaluate the module
> and use object-contract on the exports (non-optimal because dependent
> contracts will have ...s in them, etc).
`object-contract' looks like its only for stuff from the class system,
right? Did you mean some other function?
In the meantime I tried a hack of extracting the internal
provide/contract-id-foo things and trying to print them, but it isn't
working. Basically I added this to the expanded module code:
(#%provide magic)
(define-values (magic) (list provide/contract-contract-id-foo))))
And then (eval '(printf "~a\n" magic)), but the contracts just print as
#<procedure:predicate-contract>
Maybe a better way is to local-expand the module but stop on
provide/contract and extract the contracts directly from the
provide/contract form?