[plt-scheme] box contract
Yes I did that. And robby pointed that out to me later aswell. I was just
wondering if there was a built in for it and if there wasn't (which I didn't
find in helpdesk) I wanted to suggest there be one. I probablly should have
filed a change request but I wasn't sure if I was missing it's existance.
-mike
On Thu, Jul 25, 2002 at 09:51:50AM -0400, John Clements wrote:
> 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
>