Hi folks,

I'm having trouble understanding the docs on hash contracts (

What I'm trying to express is:

- This function returns #t because it is a simple test function intended to
get the hang of hash contracts...
- This function takes one argument...
- Which is a hash...
- Which has keys 'success, 'file-id, 'scratchdir-path, and 'chunk-hash...
- All of which are symbols...
- The values will be, respectively:
success boolean?
file-id (or/c #f exact-positive-integer?)
scratchdir-path path-string?
chunk-hash string?

My first attempt was:

(define/contract (x h)
  (-> (hash/dc [file-id symbol?]          [a (file-id) (or/c #f
               [scratchdir-path symbol?]  [b (scratchdir-path) path-string?]
               [chunk-hash symbol?]       [c (chunk-hash) string?]
               [success symbol?]          [d (success) boolean?])

My second attempt was:
(define/contract (x h)
  (-> (hash/dc [file-id symbol?
                        scratchdir-path symbol?
                        chunk-hash symbol?
                        success symbol?]
               [a (file-id) (or/c #f exact-positive-integer?)
                b (scratchdir-path) path-string?
                c (chunk-hash) string?
                d (success) boolean?])

Both of these have syntax issues and I can't make heads or tails of the
docs.  Help, please?

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