mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-28 16:00:22 +02:00
Removed commented out code.
This commit is contained in:
parent
327114a26a
commit
db61edbc10
1 changed files with 0 additions and 40 deletions
|
@ -35,43 +35,3 @@
|
|||
(define (array-shape a)
|
||||
(map (lambda (ind) (if (number? ind) (list 0 (+ -1 ind)) ind))
|
||||
(array-dimensions a)))
|
||||
|
||||
; (let ((make-array-proc (lambda (template)
|
||||
; (lambda (c port)
|
||||
; (read:uniform-vector template port)))))
|
||||
; (for-each (lambda (char template)
|
||||
; (read-hash-extend char
|
||||
; (make-array-proc template)))
|
||||
; '(#\a #\u #\e #\s #\i #\c #\y #\h #\l)
|
||||
; '(#\a 1 -1 1.0 1/3 0+i #\nul s l)))
|
||||
|
||||
; (let ((array-proc (lambda (c port)
|
||||
; (read:array c port))))
|
||||
; (for-each (lambda (char) (read-hash-extend char array-proc))
|
||||
; '(#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9)))
|
||||
|
||||
(define (read:array digit port)
|
||||
(define chr0 (char->integer #\0))
|
||||
(let ((rank (let readnum ((val (- (char->integer digit) chr0)))
|
||||
(if (char-numeric? (peek-char port))
|
||||
(readnum (+ (* 10 val)
|
||||
(- (char->integer (read-char port)) chr0)))
|
||||
val)))
|
||||
(prot (if (eq? #\( (peek-char port))
|
||||
'()
|
||||
(let ((c (read-char port)))
|
||||
(case c ((#\b) #t)
|
||||
((#\a) #\a)
|
||||
((#\u) 1)
|
||||
((#\e) -1)
|
||||
((#\s) 1.0)
|
||||
((#\i) 1/3)
|
||||
((#\c) 0+i)
|
||||
(else (error "read:array unknown option " c)))))))
|
||||
(if (eq? (peek-char port) #\()
|
||||
(list->uniform-array rank prot (read port))
|
||||
(error "read:array list not found"))))
|
||||
|
||||
(define (read:uniform-vector proto port)
|
||||
(if (eq? #\( (peek-char port))
|
||||
(list->uniform-array 1 proto (read port))))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue