home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Frozen Fish 2: PC
/
frozenfish_august_1995.bin
/
bbs
/
d09xx
/
d0963.lha
/
SIOD
/
scm
/
matrix.scm
< prev
next >
Wrap
Text File
|
1993-08-19
|
669b
|
21 lines
(define (matrix . args)
(if (null? (cdr args))
(car args)
(do ((res (make-vector (car args)))
(ind (-1+ (car args)) (-1+ ind)))
((< ind 0) res)
(vector-set! res ind (apply matrix (cdr args))))))
(define (matrix-ref m . args)
(do ((res m))
((null? args) res)
(set! res (vector-ref res (car args)))
(set! args (cdr args))))
(define (matrix-set! m . args)
(do ((res m))
((null? (cddr args)) (vector-set! res (car args) (cadr args)))
(set! res (vector-ref res (car args)))
(set! args (cdr args))))