[racket] define-predicate problem with HashTable type constructor

From: Erik Pearson (erik at adaptations.com)
Date: Sun Oct 20 12:51:59 EDT 2013

Thanks, I'll leave that lesson for another day! I've reverted back to using
the non-typed predicate. I had originally done this as the first step to
solving a chaperone problem with a hasheq being seen as a hash, but that
was a bug with 5.3.6 since fixed in the git master branch, but switching to
it (now off topic) broke my http client code, which is now fixed... Some
days life with Racket is a drag, but the rest of the days make up for it :)


On Sat, Oct 19, 2013 at 11:25 AM, Asumu Takikawa <asumu at ccs.neu.edu> wrote:

> On 2013-10-19 10:26:22 -0700, Erik Pearson wrote:
> >    Type Checker: Type X could not be converted to a contract. in: X
>
> This is not a bug. To construct a predicate for a type, the type has to
> have a contract that can be immediately checked (like `number?`).
>
> That's not possible in general for a hashtable because it may be
> mutable, and its contents must be checked on any read or write.
>
> You may want to consider using a cast instead.
>
> Cheers,
> Asumu
>



-- 
Erik Pearson
Adaptations
;; web form and function
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20131020/7d10e602/attachment.html>

Posted on the users mailing list.