[CM] Re : Newbie question - and about them

Heinrich Taube taube at uiuc.edu
Sun May 9 15:58:26 PDT 2010


well of course YOU need to define your list of lists, how would I have  
any idea what you think should  be in these lists of numbers??
if you just want a few lists of random numbers  to try out you could do


(define list-of-lists
   (loop repeat 10 collect (loop repeat 10 collect (random 1000)))





On May 9, 2010, at 5:18 PM, Rune Boutroue Bekkhus wrote:

> This works just fine:
> (map (lambda (l) (apply max l)) '((12 13 14) (75 76 87)))
> ---> (14 87)
>
> But I don't get the Grace app. to understand "list-of-lists". Should  
> I make a definition of that first in order to make the "highest- 
> number" function work?
>
> Also in the loop version I get ">>> Error: list-of-lists: unbound  
> variable".
>
> Rune (from Norway - no courses in proximity. And hardly any  
> appropriate documentation in Norwegian)
> ___
> Quotes:
>
> (define highest-numbers
>   (map (lambda (l) (apply max l))  list-of-lists))
>
> (define highest-numbers
>   (loop for l in list-of-lists
>         collect (apply max l)))
>
>
>



More information about the Cmdist mailing list