> 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.

Reply via email to