import lists.zipWith
def dot( a, b )
| a.length() == b.length() = sum( zipWith((*), a, b) )
| otherwise = error( "Vector sizes must match" )
println( dot([1, 3, -5], [4, -2, -1]) )