All pastes #249011 Raw Edit

Untitled

public text v1 · immutable
#249011 ·published 2006-11-15 08:27 UTC
rendered paste body
(define (create-matrix n alon)
  (local ((define (createRow n alon)
            (cond [(= n 0) empty]
                  [else (cons (first alon) (createRow (sub1 n) (rest alon)))]))
          (define (chop n alon)
            (cond [(= n 0) alon]
                  [else (chop (sub1 n) (rest alon))])))
  (cond [(empty? alon) empty]
        [(= n 0) empty]
        [else (cons (createRow n alon) (create-matrix n (chop n alon)))])))