RosettaCodeData/Task/Averages-Simple-moving-average/PicoLisp/averages-simple-moving-average-1.l

6 lines
156 B
Text
Raw Permalink Normal View History

2013-04-10 14:58:50 -07:00
(de sma (@Len)
(curry (@Len (Data)) (N)
(push 'Data N)
(and (nth Data @Len) (con @)) # Truncate
(*/ (apply + Data) (length Data)) ) )