[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.lisp

Re: Your introduction to Lisp...

William James

2/13/2016 10:01:00 PM

> (sort (vector '(1 2) '(3 5) '(-3 8) '(33 0)) #'> :key 'first)

MatzLisp (Ruby):

[[-3,9],[4,2],[222,0],[-3,5]].sort_by &:last
==>[[222, 0], [4, 2], [-3, 5], [-3, 9]]


>
> or
>
> (find -3 (vector '(1 2) '(3 5) '(-3 8) '(33 0)) :key 'first :from-end t)

[[-3,2],[4,5],[0,8],[-3,9_000]].reverse_each.find{|x| -3==x[0]}
===>
[-3, 9000]

--
I think that we have to remember that the real activists who are doing this are
motivated not by love for humanity ... ; they are motivated by hatred for the
traditional people and culture of America ... [and] the traditional people and
culture of the European countries. ---
www.redicecreations.com/radio/2014/09/RIR-140929.php