summaryrefslogtreecommitdiff
path: root/Examples/guile/matrix
diff options
context:
space:
mode:
authorMatthias Köppe <mkoeppe@mail.math.uni-magdeburg.de>2000-09-04 17:35:58 +0000
committerMatthias Köppe <mkoeppe@mail.math.uni-magdeburg.de>2000-09-04 17:35:58 +0000
commitcc80874371a7a58fed97421cd8921dd2682522a4 (patch)
treede8565e4f69fe5887b1e52d274f72fe25ce5a179 /Examples/guile/matrix
parent4a6eb364d8019cd5826427f67b2d1aab739c373e (diff)
downloadswig-cc80874371a7a58fed97421cd8921dd2682522a4.tar.gz
Last-minute changes to get Guile examples running on Guile1.4 on Solaris.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@846 626c5289-ae23-0410-ae9c-e8d60b6d4f22
Diffstat (limited to 'Examples/guile/matrix')
-rwxr-xr-xExamples/guile/matrix/matrix.scm13
1 files changed, 7 insertions, 6 deletions
diff --git a/Examples/guile/matrix/matrix.scm b/Examples/guile/matrix/matrix.scm
index 7a229b82b..18e52842d 100755
--- a/Examples/guile/matrix/matrix.scm
+++ b/Examples/guile/matrix/matrix.scm
@@ -115,7 +115,7 @@
(rand-loop M (+ i 1) 0))))
(rand-loop M 0 0))
-;;; stray definitions colleced here
+;;; stray definitions collected here
(define (rot-test M v t i)
(if (< i 360) (begin
@@ -124,10 +124,11 @@
(transform M v t)
(rot-test M v t (+ i 1)))))
-(define (create-matrix i) ; Create some matrices
- (if (< i 200)
- (cons (new-matrix) (create-matrix (+ i 1)))
- (list)))
+(define (create-matrix) ; Create some matrices
+ (let loop ((i 0) (result '()))
+ (if (< i 200)
+ (loop (+ i 1) (cons (new-matrix) result))
+ result)))
(define (add-mat M ML)
(define (add-two m1 m2 i j)
@@ -161,7 +162,7 @@
(define M1 (new-matrix)) ; a matrix
(define v (createv 1 2 3 4)) ; a vector
(define t (createv 0 0 0 0)) ; the zero-vector
-(define M-list (create-matrix 0)) ; get list of marices
+(define M-list (create-matrix)) ; get list of marices
(define M (new-matrix)) ; yet another matrix
(display "variables defined\n")