[plt-scheme] box contract
At 3:22 PM -0400 7/24/02, Mike T. Machenry wrote:
>[Please handle PLT Scheme list administrative tasks through the Web:
> http://list.cs.brown.edu/mailman/listinfo/plt-scheme]
>
>Is there a proper way to contract a box to be a specific type of box?
>
>;;i could easily contract it as such
>(provide/contract
> (number-changer (box? . -> . void?)))
>
>;;this has more desirable expresability
>(provide/contract
> (number-changer ((box-of number?) . -> . void?)))
>
>-mike
Mike, why not write the predicate yourself? Viz:
(define (box-of pred)
(lambda (x)
(and (box? x)
(pred (unbox x)))))
john