Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion What am I doing wrong in this typed racket program?
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Robby Findler  
View profile  
 More options Sep 18 2012, 6:25 pm
From: Robby Findler <ro...@eecs.northwestern.edu>
Date: Tue, 18 Sep 2012 17:23:47 -0500
Local: Tues, Sep 18 2012 6:23 pm
Subject: Re: [racket] What am I doing wrong in this typed racket program?
Can you explain more? Surely TR must know what "Setof" is, because it
translated it to "set/c" and surely it must know what "Any" is, since
it turned it into some other contract. That seems like enough
information to me.

Robby

On Tue, Sep 18, 2012 at 5:00 PM, Sam Tobin-Hochstadt <sa...@ccs.neu.edu> wrote:
> I'm saying that I don't at the moment know how to avoid giving this
> error, given the current behavior of `set/c`.

> On Tue, Sep 18, 2012 at 5:57 PM, Robby Findler
> <ro...@eecs.northwestern.edu> wrote:
>> Are you saying it is reasonable that a typed racket program should
>> produce contract constructor errors like that?

>> Robby

>> On Tue, Sep 18, 2012 at 4:53 PM, Sam Tobin-Hochstadt <sa...@ccs.neu.edu> wrote:
>>> The problem here is that `Any` is a special contract which isn't a
>>> "chaperone contract", and `set/c` requires chaperone contracts.

>>> It's not obvious to me if this can be detected statically, but you can
>>> work around this by changing `Any` to some other type.

>>> Sam

>>> On Tue, Sep 18, 2012 at 5:44 PM, Tony Garnock-Jones <to...@ccs.neu.edu> wrote:
>>>> Hi all,

>>>> What could I be doing wrong here?

>>>>     #lang typed/racket
>>>>     (provide (struct-out foo))
>>>>     (struct: foo ([bar : (Setof Any)]))

>>>> Racket 5.3.0.24 complains about it ("racket problem.rkt"):

>>>>     set/c: contract violation
>>>>       expected: chaperone-contract?
>>>>       given: #<make-contract>
>>>>       context...:
>>>>        /Users/tonyg/src/racket-typed-matrix/problem.rkt: [running body]

>>>> The complaint vanishes if I comment out the provide, remove the bar
>>>> field, or change the bar field's type to Any/Integer/etc.

>>>>   Tony
>>>> ____________________
>>>>   Racket Users list:
>>>>   http://lists.racket-lang.org/users

>>> --
>>> sam th
>>> sa...@ccs.neu.edu
>>> ____________________
>>>   Racket Users list:
>>>   http://lists.racket-lang.org/users

> --
> sam th
> sa...@ccs.neu.edu

____________________
  Racket Users list:
  http://lists.racket-lang.org/users

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.