{"size": 1002, "ext": "rktl", "max_stars_repo_path": "pkgs/racket-benchmarks/tests/racket/benchmarks/shootout/typed/hash2.rktl", "max_stars_repo_name": "lkh01/racket", "max_stars_repo_stars_event_min_datetime": "2018-07-05T21:18:24.000Z", "max_stars_repo_stars_event_max_datetime": "2021-06-04T14:48:37.000Z", "max_issues_repo_path": "pkgs/racket-benchmarks/tests/racket/benchmarks/shootout/typed/hash2.rktl", "max_issues_repo_name": "lkh01/racket", "max_issues_repo_issues_event_min_datetime": "2017-05-10T07:33:20.000Z", "max_issues_repo_issues_event_max_datetime": "2018-07-19T15:49:46.000Z", "max_forks_repo_path": "pkgs/racket-benchmarks/tests/racket/benchmarks/shootout/typed/hash2.rktl", "max_forks_repo_name": "lkh01/racket", "max_forks_repo_forks_event_min_datetime": "2016-04-25T11:47:57.000Z", "max_forks_repo_forks_event_max_datetime": "2017-05-09T14:52:48.000Z"}
{"max_stars_count": 4, "max_issues_count": 9, "max_forks_count": 3, "avg_line_length": 38.5384615385, "max_line_length": 84, "alphanum_fraction": 0.4680638723}
(: main ((Vectorof String) -> Void))
(define (main argv)
  (let*: ([n : Integer (assert (string->number (vector-ref argv 0)) exact-integer?)]
          [hash1 : (HashTable String Integer) (make-hash)]
          [hash2 : (HashTable String Integer) (make-hash)]
          [zero : ( -> 0) (lambda () 0)])
    (let loop ([i 0])
      (unless (= i 10000)
        (hash-set! hash1 (string-append "foo_" (number->string i)) i)
        (loop (add1 i))))
    (let loop ([i 0])
      (unless (= i n)
        (hash-for-each hash1 (lambda: ((key : String) (value : Integer))
                               (hash-set!
                                hash2
                                key
                                (+ (hash-ref hash2 key zero) value))))
        (loop (add1 i))))
    (printf "~s ~s ~s ~s\n"
            (hash-ref hash1 "foo_1")
            (hash-ref hash1 "foo_9999")
            (hash-ref hash2 "foo_1")
            (hash-ref hash2 "foo_9999"))))

(main (current-command-line-arguments))
