1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
|
;; -*-theme-d-*-
;; Copyright (C) 2016, 2021 Tommi Höynälänmaa
;; Distributed under GNU Lesser General Public License version 3,
;; see file doc/LGPL-3.
(define-interface (standard-library iterator)
(import (standard-library core))
(declare :consumer <param-logical-type>)
(define-param-logical-type :iterator-inst (%source %target)
(:procedure ((:consumer %source %target)) %target pure))
(define-param-logical-type :iterator (%source)
(:param-proc (%target) ((:consumer %source %target)) %target pure))
(define-param-logical-type :consumer (%source %target)
(:procedure ((:maybe %source) <boolean>
(:maybe (:iterator-inst %source %target)))
%target pure))
(declare-param-method end-iter (%source %target)
((:consumer %source %target))
%target pure)
(declare-param-method gen-list
(%source %target)
((:uniform-list %source)
(:consumer %source %target)
(:iterator-inst %source %target))
%target pure)
(declare-param-method get-list-iterator (%source)
((:uniform-list %source))
(:iterator %source)
pure)
(declare-param-method gen-mutable-vector (%source %target)
((:mutable-vector %source)
(:consumer %source %target)
(:iterator-inst %source %target))
%target pure)
(declare-param-method get-mutable-vector-iterator
(%source)
((:mutable-vector %source))
(:iterator %source)
pure)
(declare-param-method iter-map1 (%source %component)
((:procedure (%source) %component pure)
(:iterator %source))
(:uniform-list %component)
pure)
(declare-param-method iter-map2 (%source1 %source2 %component)
((:procedure (%source1 %source2)
%component pure)
(:iterator %source1)
(:iterator %source2))
(:uniform-list %component)
pure)
(declare-param-method iter-every1 (%source)
((:procedure (%source) <boolean> pure)
(:iterator %source))
<boolean>
pure)
(declare-param-method iter-every2 (%source1 %source2)
((:procedure (%source1 %source2)
<boolean> pure)
(:iterator %source1)
(:iterator %source2))
<boolean>
pure))
|