Arc Forumnew | comments | leaders | submitlogin
Problems with min
1 point by vrk 6160 days ago | 2 comments
I don't understand the way min works in arc1:

  (min (map abs '(-1 -2)))  
This gives (1 2), not 1 as I would have expected. Reading the source reveals that min is variadic, and doesn't really understand anything about lists. Is there a way to flatten the list in some way so that I could actually use the min function?


5 points by mattjones 6160 days ago | link

You would do

    (apply min (map abs '(-1 -2)))

-----

3 points by vrk 6160 days ago | link

Thank you. Just shows how little I have really programmed in Lisp...

-----