#lang racket

;(build-vector n proc) → vector?
;  n : exact-nonnegative-integer?
;  proc : (exact-nonnegative-integer? . -> . any/c)
;Creates a vector of n elements by applying proc to the integers from 0 to (sub1 n) in order. If vec is the resulting vector, then (vector-ref vec i) is the value produced by (proc i).
;Example:
;> (build-vector 5 add1)
;'#(1 2 3 4 5)
;;;;;;;;;;;;;;;;;;;;;Matrices
;matriz = vector de (* filas columnas) + 1 (= nº columnas) de elementos
(define-syntax make-matriz
 (syntax-rules ()
   ((make-matriz filas columnas)
    (build-vector filas 
                  (lambda (x) 
                        (make-vector columnas)
                    ))
    )
   ))
(define-syntax matriz-set!
  (syntax-rules ()
    ((matriz-set! name fila columna new)
     (begin
       (vector-set! (vector-ref name fila) columna new)
       name
       )
     )
    ))
(define-syntax matriz-ref
  (syntax-rules ()
    ((matriz-ref nombre fila columna proc)
     (let ((row (proc nombre fila))
          )
      (proc row columna))
     )
    ))

;;;;;;;;;;;;;;;;;;;;;
;(define q (make-matriz 10 10 '()))
;q
;(matriz-set! q 3 5 'B)
;q

(provide make-matriz matriz-set! matriz-ref)