;; -*-theme-d-*-

;; Copyright (C) 2014  Tommi Höynälänmaa
;; Distributed under GNU General Public License version 3,
;; see file doc/GPL-3.

;; Expected results: translation and running OK


(define-proper-program (tests test163)


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


  (define main
    (lambda (() <integer> nonpure)
      (let ((myvec1 (make-mutable-vector (:maybe <integer>) 5 null))
	    (myvec2 (make-mutable-value-vector (:maybe <real>) 6 null)))
	(mutable-vector-set! myvec1 0 1)
	(mutable-vector-set! myvec1 1 -1)
	(mutable-vector-set! myvec1 2 10)
	(mutable-vector-set! myvec1 3 5)
	(mutable-vector-set! myvec1 4 7)
	(mutable-value-vector-set! myvec2 0 1.0)
	(mutable-value-vector-set! myvec2 1 2.0)
	(mutable-value-vector-set! myvec2 2 -1.0)
	(mutable-value-vector-set! myvec2 3 1.5)
	(mutable-value-vector-set! myvec2 4 7.5)
	(mutable-value-vector-set! myvec2 5 1.2)
	(let ((myvec3 (cast-vector
		       <integer>
		       (cast-vector-metaclass myvec1)))
	      (myvec4 (cast-value-vector
		       <real>
		       (cast-value-vector-metaclass myvec2))))
	  (let-mutable ((i <integer> 0))
	    (until ((>= i 5))
	      (console-display (vector-ref myvec3 i))
	      (console-newline)
	      (set! i (+ i 1))))
	  (console-newline)
	  (let-mutable ((i <integer> 0))
	    (until ((>= i 6))
	      (console-display (value-vector-ref myvec4 i))
	      (console-newline)
	      (set! i (+ i 1))))))
      0)))
