[CM] Newbie question - and about them

Heinrich Taube taube at uiuc.edu
Sat May 8 14:01:18 PDT 2010


> My quick suggestion is:

[...]

ooof.  if you like pure scheme:

(define highest-numbers
   (map (lambda (l) (apply max l))  list-of-lists))

if you have loop:

(define highest-numbers
   (loop for l in list-of-lists
         collect (apply max l)))

i hope i havent done someone's homwork ;)


On May 8, 2010, at 3:11 PM, Aykut Caglayan wrote:

> My quick suggestion is:
>
> > (let ((l1 '(300 4 5995 6 90))
>             (l2 '(33 2 90 8))
>             (l3 '(9 782 9)))
>   (loop for l in `(,l1 ,l2 ,l3);;list of lists;;
>         with result = '()
>         do
>         (set! result (append result
>                              (list (loop for nl in l
>                                          with i = most-negative-fixnum
>                                          do
>                                          (when (> nl i)
>                                            (set! i nl))
>                                          finally (return i)))))
>         finally (return result)))
>
> > (5995 90 782)
>
> _______________________________________________
> Cmdist mailing list
> Cmdist at ccrma.stanford.edu
> http://ccrma-mail.stanford.edu/mailman/listinfo/cmdist



More information about the Cmdist mailing list