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?

Received: by 10.224.52.195 with SMTP id j3mr1070253qag.0.1348007145095;
        Tue, 18 Sep 2012 15:25:45 -0700 (PDT)
X-BeenThere: racket-users@googlegroups.com
Received: by 10.229.38.21 with SMTP id z21ls617812qcd.2.gmail; Tue, 18 Sep
 2012 15:25:45 -0700 (PDT)
Received: by 10.224.223.84 with SMTP id ij20mr1062407qab.5.1348007144978;
        Tue, 18 Sep 2012 15:25:44 -0700 (PDT)
Received: by 10.224.223.84 with SMTP id ij20mr1062406qab.5.1348007144966;
        Tue, 18 Sep 2012 15:25:44 -0700 (PDT)
Return-Path: <users-boun...@racket-lang.org>
Received: from champlain.ccs.neu.edu (champlain.ccs.neu.edu. [129.10.115.116])
        by gmr-mx.google.com with ESMTPS id mx3si366537qcb.3.2012.09.18.15.25.44
        (version=TLSv1/SSLv3 cipher=OTHER);
        Tue, 18 Sep 2012 15:25:44 -0700 (PDT)
Received-SPF: neutral (google.com: 129.10.115.116 is neither permitted nor denied by domain of users-boun...@racket-lang.org) client-ip=129.10.115.116;
Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 129.10.115.116 is neither permitted nor denied by domain of users-boun...@racket-lang.org) smtp.mail=users-boun...@racket-lang.org
Received: from champlain.ccs.neu.edu (localhost.localdomain [127.0.0.1])
	by champlain.ccs.neu.edu (8.14.4/8.14.4) with ESMTP id q8IMNrH8009678;
	Tue, 18 Sep 2012 18:24:04 -0400
Received: from mail-ob0-f174.google.com (mail-ob0-f174.google.com
	[209.85.214.174])
	by champlain.ccs.neu.edu (8.14.4/8.14.4) with ESMTP id q8IMNmWV009658
	for <us...@lists.racket-lang.org>; Tue, 18 Sep 2012 18:23:48 -0400
Received: by obc16 with SMTP id 16so200244obc.33
	for <us...@lists.racket-lang.org>; Tue, 18 Sep 2012 15:23:48 -0700 (PDT)
	d=google.com; s=20120113;
	h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf
	:dkim-signature:mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type
	:x-gm-message-state;
	bh=6b1qW/zlLrcGtMgQ+q3XeEyztOiyV7llz2xTY+jq6ms=;
	b=ZqA44K3ufsJe8DkB0pTaVFNWZKElC5DhxaIF3BJPahzy/T08JvClOJF45/RFx8dvNQ
	NWhLPBSHVvaYZfDT+voxrIoxyc294tN5Fd0jLNj+1coyjDMBr0XFD1sr3Nt8Vdeoapx3
	9CJJO+iaxPt9O+EcnFOyd9P1oApk32x38NFIHfkdU/JI5zmEg/9uDFMR6W8oDEg+OzjJ
	4bmRPlpIJslgrhhMhsrudBVVxZMJZeuHKtB0xzLphgUszJFme0VpQcdX5rSj4pXFf//e
	wodVYito56aPW4BwxRTJdTqI3QqGT6ze04JB+dYynM+4PdjMScPjiNrRXHpnzcx7m9JV
	hRqA==
Received: by 10.60.0.161 with SMTP id 1mr1579469oef.83.1348007028138;
	Tue, 18 Sep 2012 15:23:48 -0700 (PDT)
X-Forwarded-To: us...@lists.racket-lang.org
X-Forwarded-For: us...@plt-scheme.org us...@lists.racket-lang.org
Delivered-To: us...@racket-lang.org
Received: by 10.76.13.162 with SMTP id i2csp87410oac;
	Tue, 18 Sep 2012 15:23:47 -0700 (PDT)
Received: by 10.182.159.42 with SMTP id wz10mr1557123obb.49.1348007027676;
	Tue, 18 Sep 2012 15:23:47 -0700 (PDT)
Received: from mail-oa0-f45.google.com (mail-oa0-f45.google.com
	[209.85.219.45])
	by mx.google.com with ESMTPS id 10si889111oef.11.2012.09.18.15.23.47
	(version=TLSv1/SSLv3 cipher=OTHER);
	Tue, 18 Sep 2012 15:23:47 -0700 (PDT)
Received-SPF: pass (google.com: domain of robby.find...@gmail.com designates
	209.85.219.45 as permitted sender) client-ip=209.85.219.45;
Received: by oagn12 with SMTP id n12so389434oag.4
	for <us...@racket-lang.org>; Tue, 18 Sep 2012 15:23:47 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.60.27.9 with SMTP id p9mr1565761oeg.69.1348007027412; Tue, 18
	Sep 2012 15:23:47 -0700 (PDT)
Received: by 10.76.12.74 with HTTP; Tue, 18 Sep 2012 15:23:47 -0700 (PDT)
In-Reply-To: <CAK=HD+Zf5121Xb=Atq9arRJy-7gAgeCT8Ou0O5L_RJOdFx4...@mail.gmail.com>
References: <5058EB4C.5040...@ccs.neu.edu>
	<CAK=HD+Y+65EQsx+h0tbxv-cunB7kHP5ZxmtUOrHgWky-n7p...@mail.gmail.com>
	<CAL3TdONFZTJwUE4kKA6Wd_LJZi-XyGwKrG1TanLnZNv=FAp...@mail.gmail.com>
	<CAK=HD+Zf5121Xb=Atq9arRJy-7gAgeCT8Ou0O5L_RJOdFx4...@mail.gmail.com>
Date: Tue, 18 Sep 2012 17:23:47 -0500
Message-ID: <CAL3TdOPF2xY0PnXGy_+xsKe1X8o2-kURVQY_tG5UjK-0uDG...@mail.gmail.com>
From: Robby Findler <ro...@eecs.northwestern.edu>
To: Sam Tobin-Hochstadt <sa...@ccs.neu.edu>
X-Gm-Message-State: ALoCoQmZAs4hxSvyA9p72JpFQsVDFI9fa51M8GsrmRQVWrn5OM0kDWKs5pO/XtpAjz1Y8553qWDQ
X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,
	DKIM_VALID,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on
	champlain.ccs.neu.edu
Cc: Racket Users <us...@racket-lang.org>
Subject: Re: [racket] What am I doing wrong in this typed racket program?
X-BeenThere: us...@racket-lang.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: Racket Users <users.racket-lang.org>
List-Unsubscribe: <http://lists.racket-lang.org/users/options>,
	<mailto:users-requ...@racket-lang.org?subject=unsubscribe>
List-Archive: <http://lists.racket-lang.org/users/archive/>
List-Post: <mailto:us...@racket-lang.org>
List-Help: <mailto:users-requ...@racket-lang.org?subject=help>
List-Subscribe: <http://lists.racket-lang.org/users/listinfo>,
	<mailto:users-requ...@racket-lang.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: users-boun...@racket-lang.org
Errors-To: users-boun...@racket-lang.org

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