;; -*-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 test298)


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


  (define-simple-proc disp (((obj <object>)) <none> nonpure)
    (console-display obj)
    (console-newline))


  (define main
    (lambda (() <integer> nonpure)
      (let* ((lst1 (list 1 2 3 4 5))
	     (lst2 (map1 (lambda (((i <integer>)) <integer> pure) (+ i 1))
			 lst1))
	     (lst3 (map-nonpure1
	     	    (lambda (((i <integer>)) <integer> nonpure) (+ i 1))
	     	    lst1))
	     (p1? (and-map1? (lambda (((i <integer>)) <boolean> pure)
	     		       (>= i 0))
	     		     lst1))
	     (p2? (or-map1? (lambda (((i <integer>)) <boolean> pure)
	     		      (<= i 0))
	     		    lst1)))
	(for-each1 disp lst1)
	(disp lst2)
	(disp lst3)
	(disp p1?)
	(disp p2?)
      0))))
