PasteRack.org
Paste # 70940
2018-04-10 20:18:42

Fork as a new paste.

Paste viewed 326 times.


Embed:

  1. #lang racket
  2.  
  3. (define a (list (list -4 20) (list -2 13)))
  4. (define b (list (list -4 20) (list -2 13)))
  5.  
  6.  
  7. (define (matrix a b)
  8.     (if (and (null? a) (null? b))
  9.         0
  10.         (+ (* (car (car a)) (car (car b))) (*(cadr(car a)) (car(cdr b))))))
  11.  
  12. (matrix a b)

=>

*: contract violation

  expected: number?

  given: '(-2 13)

  argument position: 2nd

  other arguments...:

   20