;; -*-theme-*-

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

(define-proper-program (examples sequence-sgn-test)


  (import (standard-library core)
	  (standard-library console-io)
	  (examples sequence-sgn)
	  (examples sequence-list-impl)
	  (examples sequence-vector-impl))


  (define-param-method display-sequence (%element)
		     (((seq (:sequence %element))) <none> nonpure)
    (let ((i-len <integer> (sequence-length seq)))
      (do ((i <integer> 0 (+ i 1))) ((>= i i-len))
        (console-display (sequence-ref seq i))
        (console-newline))))


  (define-simple-method my-proc (((i <integer>)) <integer> pure)
    (+ i 1))


  (define-main-proc (() <none> nonpure)
    (let* ((seq (list 1 2 3 4 5))
	   (seq2 (sequence-map my-proc seq))
	   (seq3 (mutable-vector <real> 2.0 3.0 4.0)))
      (display-sequence seq2)
      (console-newline)
      (display-sequence seq3)
      (console-newline))))
