sunterlib/s48/sequences/specseqs.scm

17 lines
517 B
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
;;; sequence procedures for specific types (for lists, actually)
;;; list-set! sublist list-fill!
;; unspecified return value as usual
(define (list-set! xs k x)
(set-car! (drop xs k) x))
(define (sublist xs start end)
(take (drop xs start) (- end start)))
2003-02-16 17:39:24 -05:00
;; unspecified return value -- no [start end] for now
2003-02-11 19:23:30 -05:00
(define (list-fill! xs x)
(pair-for-each (lambda (p) (set-car! p x)) xs))