;; -*-theme-*-

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

(define-interface (examples list-as-sequence)

  (import (standard-library core)
	  (examples sequence))

  (define-param-class :list-as-sequence
    (parameters %element)
    (superclass (:sequence %element))
    (construct ((contents1 (:uniform-list %element))))
    (fields
     (contents (:uniform-list %element) public hidden contents1)))
     
  (declare-param-virtual-method sequence-ref
				(%element)
				((:list-as-sequence %element) <integer>)
				%element
				pure)

  (declare-param-virtual-method sequence-length
				(%element)
				((:list-as-sequence %element))
				<integer>
				pure)

  (declare-param-virtual-method sequence-map
				(%source %target)
				((:procedure (%source) %target pure)
				 (:list-as-sequence %source))
				(:list-as-sequence %target)
				pure))
