about summary refs log tree commit diff stats
path: root/chicanery.extras.scm
diff options
context:
space:
mode:
Diffstat (limited to 'chicanery.extras.scm')
-rw-r--r--chicanery.extras.scm15
1 files changed, 4 insertions, 11 deletions
diff --git a/chicanery.extras.scm b/chicanery.extras.scm index bcb4929..ae2823e 100644 --- a/chicanery.extras.scm +++ b/chicanery.extras.scm
@@ -1,11 +1,6 @@
1;;; chicanery extras --- extra stuff from ur old pal acdw
2
3(export list-map list-for-each list-append 1(export list-map list-for-each list-append
4 map for-each append) 2 map for-each append)
5 3
6;;; Generalized map, for-each, ...
7;; List versions are renamed `list-<function>'. Un-prefixed versions work
8;; with any (default) datatype. TODO: generalize?
9(define list-map map) 4(define list-map map)
10(define list-for-each for-each) 5(define list-for-each for-each)
11(define list-append append) 6(define list-append append)
@@ -45,9 +40,6 @@
45 (apply bytevector-append collections)) 40 (apply bytevector-append collections))
46 (else (error "Bad datatype" first))))) 41 (else (error "Bad datatype" first)))))
47 42
48(export ref
49 copy)
50
51;;; Extended generic functions. 43;;; Extended generic functions.
52;; These functions already have a list- version defined, but no non-prefixed 44;; These functions already have a list- version defined, but no non-prefixed
53;; one. So I'm fixing that. 45;; one. So I'm fixing that.
@@ -77,14 +69,12 @@
77 (bytevector-copy collection)) 69 (bytevector-copy collection))
78 (else (error "Bad datatype" collection)))) 70 (else (error "Bad datatype" collection))))
79 71
80;;; Functions that should be in scheme 72;;; Definitions that should be in scheme
81;; This sections should be as small as possible 73;; This sections should be as small as possible
82 74
83(export read-port 75(export read-port
84 read-port-chunk-size) 76 read-port-chunk-size)
85 77
86(define read-port-chunk-size
87 (make-parameter 512))
88 78
89(define (%read-port port) 79(define (%read-port port)
90 (let ((chunk-size (read-port-chunk-size))) 80 (let ((chunk-size (read-port-chunk-size)))
@@ -104,6 +94,9 @@
104 blank? 94 blank?
105 (cons next acc))))))) 95 (cons next acc)))))))
106 96
97(define read-port-chunk-size
98 (make-parameter 512))
99
107(define read-port 100(define read-port
108 (case-lambda 101 (case-lambda
109 (() (%read-port (current-input-port))) 102 (() (%read-port (current-input-port)))