I'm trying to identify the transformer definitions that
provide/contract and contract-out generate for the provided bindings.
The last paragraph of the docs for contract-out says that
'provide/contract-original-contract is placed on "code it generates."
Oddly enough, though, contract-out's expansion does not appear to have
anything with this property. This  property does appear in the
expansion of provide/contract.

I tried looking through the contract library's source to see what the
issue is but had no luck. The two contract forms appear to go through
a common code path that attaches the syntax property, but I'm not able
to figure out what's causing it not to appear in contract-out's
expansion.

In the program below, the first module's expansion has three forms
with this property (one of which is for the transformer definition)
while the second module's expansion has none.

Does anyone know why one form adds the property but the other one
doesn't appear to? If making the two consistent isn't possible, any
thoughts on how else I could go about identifying the transformer
definition from contract-out?

Thanks!

-Brian

#lang racket
(define (find-p/c-prop form)
  (syntax-case form ()
    [_
     (syntax-property form 'provide/contract-original-contract)
     (list form)]
    [(subs ...)
     (flatten (map find-p/c-prop (syntax->list #'(subs ...))))]
    [_
     empty]))

(find-p/c-prop
 (expand
  #'(module test racket
      (provide/contract
       [x (>/c 5)])
      (define x 6))))

(find-p/c-prop
 (expand
  #'(module test racket
      (provide
       (contract-out
        [x (>/c 5)]))
      (define x 6))))

-- 
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