Task

Write a program to find the sum of squares of a numeric vector.

The program should work on a zero-length vector (with an answer of   0).



Related task

   Mean


procedure main()
   local lst
   lst := []
   #Construct a simple list and pass it to getsum
   every put(lst,seq()\2)
   write(getsum(lst))
end
 
procedure getsum(lst)
   local total
   total := 0
   every total +:= !lst ^ 2
   return total
end