
;; Copyright (C) 2017 Tommi Höynälänmaa

;; Expected results: translation and running OK

(define-proper-program (tests test587)

  (import (standard-library core)
	  (standard-library hash-table)
	  (standard-library console-io))

  (define object-hash1
    (unchecked-prim-proc hashq (<object> <integer>) <integer> pure))

  (define-simple-proc main (() <none> nonpure)
    (let ((ht (:hash-table <object> <integer>)
	      (make-hash-table-with-size
	       object-hash
	       (param-proc-instance assoc-objects1 <object> <integer>)
	       10)))
      (console-display-line (object-hash1 'abc 10))
      (console-display-line (object-hash1 'def 10))
      (console-display-line (object-hash1 'ghi 10))
      (console-display-line (object-hash1 'jkl 10))
      (hash-set! ht 'abc 1)
      (hash-set! ht 'def 10)
      (hash-set! ht 'ghi 3)
      (hash-set! ht 'jkl -1)
      (hash-for-each
       (lambda (((x-key <object>) (i-value <integer>)) <none> nonpure)
	 (console-display x-key)
	 (console-display " ")
	 (console-display i-value)
	 (console-newline))
       ht))))
