sunterlib/s48/sequences/interfaces.scm

82 lines
2.3 KiB
Scheme
Raw Normal View History

2003-02-11 19:23:30 -05:00
; Copyright (c) 2003 RT Happe <rthappe at web de>
; See the file COPYING distributed with the Scheme Untergrund Library
2003-02-12 16:48:40 -05:00
;; the basic protocol including a vanilla constructor
2003-02-11 19:23:30 -05:00
(define-interface sequence-basics-face
(export sequence?
sequence-length
sequence-ref
sequence-set!
make-another-sequence))
;; things definable in terms of the basic protocol
(define-interface sequence-extras-face
(export sequence->list
sequence-fill!
subsequence
2003-02-12 16:48:40 -05:00
sequence-copy
2003-02-15 19:32:31 -05:00
sequence-copy/maker
2003-02-12 16:48:40 -05:00
sequence-append
2003-02-13 19:47:58 -05:00
sequence-map sequences-map
2003-02-15 19:32:31 -05:00
sequence-map/maker sequences-map/maker
2003-02-13 19:47:58 -05:00
sequence-for-each sequences-for-each
sequence-fold sequences-fold
sequence-fold-right sequences-fold-right
sequence-any sequences-any
sequence-every sequences-every))
2003-02-11 19:23:30 -05:00
2003-02-13 19:47:58 -05:00
;; specialised sequence operations (for lists, actually)
2003-02-11 19:23:30 -05:00
(define-interface sequence-specifics-face
2003-02-13 19:47:58 -05:00
(export list-set!
2003-02-11 19:23:30 -05:00
list-fill!
2003-02-13 19:47:58 -05:00
sublist
))
2003-02-11 19:23:30 -05:00
;; the sequence ADT etc.
2003-02-15 19:32:31 -05:00
(define-interface absequences-face
(export make-sequence-behavior
sequence-behavior?
make-absequence-record
absequence:behavior
make-absequence/behavior
absequence/behavior
list->absequence/behavior
absequence?
absequence-ref
absequence-set!
absequence-length))
2003-02-13 19:47:58 -05:00
;; the basic + extra sequence procedures
;; [ extends the union of SEQUENCE-BASICS- and -EXTRAS-INTERFACE with
;; `VECTOR' replacing `SEQUENCE' ]
(define-interface vector-lib-face
(export ;; std constructors
vector
make-vector
;; basics w/o the vanilla constructor
vector?
vector-length
vector-ref
vector-set!
;; extras
vector->list
vector-fill!
subvector
vector-copy
vector-append
2003-02-15 19:32:31 -05:00
vector-map ; forget the optional MAKER arg
2003-02-13 19:47:58 -05:00
vector-for-each
vector-fold
vector-fold-right
vector-any
vector-every
2003-02-15 19:32:31 -05:00
vectors-map ; but not vectors-map/maker
2003-02-13 19:47:58 -05:00
vectors-for-each
vectors-fold
vectors-fold-right
vectors-any
vectors-every
))