RosettaCodeData/Task/Dot-product/EchoLisp/dot-product.echolisp
2016-12-05 23:44:36 +01:00

10 lines
182 B
Text

(define a #(1 3 -5))
(define b #(4 -2 -1))
;; function definition
(define ( ⊗ a b) (for/sum ((x a)(y b)) (* x y)))
(⊗ a b) → 3
;; library
(lib 'math)
(dot-product a b) → 3