What are the steps? I put the code below in a file named tmp.rkt, ran
"raco make tmp.rkt ; racket tmp.rkt" and see no output.

Robby

On Thu, Sep 8, 2016 at 1:17 PM, Sam Tobin-Hochstadt
<sa...@cs.indiana.edu> wrote:
> This looks like a contract system bug (or a compiler bug). If I change
> reducing-2.rkt to this:
>
> #lang racket/base
>
> (require racket/contract racket/hash)
>   (define/contract hash-union2
>     (-> (hash/c string? string?)
>         (hash/c string? string?)
>         (hash/c string? string?))
>     hash-union)
>
>   (provide modified-test-conf)
>
>   (define (modified-test-conf table)
>     (hash-union2 '#hash(("mail-server" . "smtp.sendgrid.net")) table))
>
> I get the same error, but again only with a call to `raco make` first.
>
> Sam
>
> On Thu, Sep 8, 2016 at 2:01 PM, Sam Tobin-Hochstadt
> <sa...@cs.indiana.edu> wrote:
>> Ok, now I see the error. Thanks!
>>
>> Sam
>>
>> On Thu, Sep 8, 2016 at 1:59 PM, John Clements <cleme...@brinckerhoff.org> 
>> wrote:
>>>
>>>> On Sep 8, 2016, at 10:42 AM, Sam Tobin-Hochstadt <sa...@cs.indiana.edu> 
>>>> wrote:
>>>>
>>>> I'm unable to replicate this on two different machines, with up to
>>>> date Racket. Can you try it with a snapshot?
>>>
>>> I’m using the git head right now…
>>>
>>> I just tried copying the two files to a new directory, and discovered that 
>>> I don’t see the error unless I run `raco make` beforehand.
>>>
>>> Can you try inserting ‘raco make reducing-?.rkt’ into your script below?
>>>
>>> If you still see no error I’ll try running from a snapshot.
>>>
>>> John
>>>
>>>>
>>>> Here's what I did:
>>>>
>>>> [samth@huor:~/tmp plt] cat > reducing-1.rkt
>>>>
>>>> #lang racket
>>>>
>>>> (require "reducing-2.rkt")
>>>>
>>>> (define bad (modified-test-conf
>>>>                   (hash "a" "b")))
>>>> [samth@huor:~/tmp plt] cat > reducing-2.rkt
>>>>
>>>> #lang typed/racket/base
>>>>
>>>> (require/typed racket/hash
>>>>               [hash-union ((HashTable String String)
>>>>                            (HashTable String String)
>>>>                            [#:combine (String String -> String)]
>>>>                            ->
>>>>                            (HashTable String String))])
>>>>
>>>> (provide modified-test-conf)
>>>>
>>>> (define test-conf
>>>>  '#hash(("ct-port" . "8080")
>>>>         ("mail-enable" . "fAlSe")
>>>>         ("mail-port" . "2525")
>>>>         ("mail-server" . "smtp.sendgrid.net")))
>>>>
>>>> (: modified-test-conf ((HashTable String String) -> (HashTable String 
>>>> String)))
>>>> (define (modified-test-conf table)
>>>>  (hash-union test-conf
>>>>              table
>>>>              #:combine (λ ([a : String] [b : String]) b)))
>>>>
>>>> [samth@huor:~/tmp plt] r --version
>>>> Welcome to Racket v6.6.0.4.
>>>> [samth@huor:~/tmp plt] r reducing-1.rkt
>>>> [samth@huor:~/tmp plt]
>>>>
>>>> On Thu, Sep 8, 2016 at 1:08 PM, 'John Clements' via Racket Users
>>>> <racket-users@googlegroups.com> wrote:
>>>>>
>>>>>> On Sep 7, 2016, at 10:36 AM, Sam Tobin-Hochstadt <sa...@cs.indiana.edu> 
>>>>>> wrote:
>>>>>>
>>>>>> It's not clear what's going on here without seeing more of the code. A
>>>>>> minimal example isn't necessary, just something runnable.
>>>>>
>>>>> Well, here’s something pretty small.
>>>>>
>>>>> reducing-1.rkt:
>>>>>
>>>>> #lang racket
>>>>>
>>>>> (require "reducing-2.rkt")
>>>>>
>>>>> (define bad (modified-test-conf
>>>>>                   (hash "a" "b")))
>>>>>
>>>>>>
>>>>>
>>>>> reducing-2.rkt:
>>>>> #lang typed/racket/base
>>>>>
>>>>> (require/typed racket/hash
>>>>>               [hash-union ((HashTable String String)
>>>>>                            (HashTable String String)
>>>>>                            [#:combine (String String -> String)]
>>>>>                            ->
>>>>>                            (HashTable String String))])
>>>>>
>>>>> (provide modified-test-conf)
>>>>>
>>>>> (define test-conf
>>>>>  '#hash(("ct-port" . "8080")
>>>>>         ("mail-enable" . "fAlSe")
>>>>>         ("mail-port" . "2525")
>>>>>         ("mail-server" . "smtp.sendgrid.net")))
>>>>>
>>>>> (: modified-test-conf ((HashTable String String) -> (HashTable String 
>>>>> String)))
>>>>> (define (modified-test-conf table)
>>>>>  (hash-union test-conf
>>>>>              table
>>>>>              #:combine (λ ([a : String] [b : String]) b)))
>>>>>
>>>>>
>>>>> Running reducing-1 produces this error for me:
>>>>>
>>>>> procedure chaperone: non-chaperone result;
>>>>> received a 2nd argument that is not a chaperone of the original 2nd 
>>>>> argument
>>>>>  original: '#hash(("mail-enable" . "fAlSe") ("mail-port" . "2525") 
>>>>> ("ct-port" . "8080") ("mail-server" . "smtp.sendgrid.net"))
>>>>>  received: '#hash(("mail-enable" . "fAlSe") ("mail-port" . "2525") 
>>>>> ("ct-port" . "8080") ("mail-server" . "smtp.sendgrid.net”))
>>>>>
>>>>> In the process of writing this email, I discovered that replacing the 
>>>>> ‘#hash(…) formation with (make-immutable-hash …) makes the error go away. 
>>>>> So I’m pretty happy with that workaround, but this error message is still 
>>>>> not making a huge amount of sense to me.
>>>>>
>>>>> John
>>>>>
>>>>>
>>>>>
>>>>>> Sam
>>>>>>
>>>>>> On Wed, Sep 7, 2016 at 1:31 PM, 'John Clements' via Racket Users
>>>>>> <racket-users@googlegroups.com> wrote:
>>>>>>> I’m getting chaperone errors that seem to occur when calling a function 
>>>>>>> defined in TR that uses hash-union to construct hash tables from 
>>>>>>> another file.
>>>>>>>
>>>>>>> Here’s the text of the error:
>>>>>>>
>>>>>>> procedure chaperone: non-chaperone result;
>>>>>>> received a 2nd argument that is not a chaperone of the original 2nd 
>>>>>>> argument
>>>>>>> original: '#hash(("storage-mode" . "local") ("db-password" . 
>>>>>>> "captain_teach") ("tar-binary" . "/usr/bin/tar") ("master-user" . 
>>>>>>> "masteru...@example.com") ("cloud-secret-key" . "YOUR-SECRET-KEY") 
>>>>>>> ("db-name" . "captain_teach_testing") ("zip-binary" . "/usr/bin...
>>>>>>> received: '#hash(("storage-mode" . "local") ("db-password" . 
>>>>>>> "captain_teach") ("tar-binary" . "/usr/bin/tar") ("master-user" . 
>>>>>>> "masteru...@example.com") ("cloud-secret-key" . "YOUR-SECRET-KEY") 
>>>>>>> ("db-name" . "captain_teach_testing") ("zip-binary" . "/usr/bin…
>>>>>>>
>>>>>>> Here’s what I haven’t done:
>>>>>>>
>>>>>>> 1) updated DrRacket from  6.6.0.4--2016-08-29
>>>>>>> 2) tried to minimize the code
>>>>>>>
>>>>>>> … because there’s an easy workaround. However, if anyone’s interested 
>>>>>>> in this bug, I’d be glad to try to zoom in and isolate a small example 
>>>>>>> and submit a PR.
>>>>>>>
>>>>>>> Thanks!
>>>>>>>
>>>>>>> John
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> You received this message because you are subscribed to the Google 
>>>>>>> Groups "Racket Users" group.
>>>>>>> To unsubscribe from this group and stop receiving emails from it, send 
>>>>>>> an email to racket-users+unsubscr...@googlegroups.com.
>>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>
>>>>>> --
>>>>>> You received this message because you are subscribed to the Google 
>>>>>> Groups "Racket Users" group.
>>>>>> To unsubscribe from this group and stop receiving emails from it, send 
>>>>>> an email to racket-users+unsubscr...@googlegroups.com.
>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> You received this message because you are subscribed to the Google Groups 
>>>>> "Racket Users" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send an 
>>>>> email to racket-users+unsubscr...@googlegroups.com.
>>>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>>
>>>
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to