I need to produce a list containing the averages of a lists of lists where the number of sub-lists could vary. So given the input list:
((l1a l1b l1c) (l2a l2b l2c) (l3a l3b l3c)...)
the output would be:
(average(l1a l2a l3a) average(l1b l2b l3b) average(l1c l2c l3c)...).
I'm sure there's a really elegant way to do this in lisp but I don't know where to start. Any advice would be gratefully received.
map. I don't know CL, but I do know Clojure, which is another lisp. If your lists are bound to a symbollists, you'd just do, in Clojure,(map average lists). I'm sure it's very similar in CL.mapandreduce/fold(I don't know what CL calls it). Those are bread-and-butter functions that you'll likely be using regularly.