[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.lisp

Re: Learning Lisp in Linux?

William James

12/30/2015 7:52:00 AM

Nicolas Neuss wrote:

> > does this look like assembly?
> >
> > (define (! n)
> > (let loop ((x n) (r 1))
> > (if (zero? x) r
> > (loop (- x 1) (* x r)))))
>
> Yes, it does compared with
>
> (defun factorial (n)
> (loop for n from 1 upto n
> and f = 1 then (* f n)
> finally (return f)))

MatzLisp (Ruby):

def fact n
(1..n).reduce{|f,i| f*i}
end


--
Amazon bans book. After nearly a month on the site, all traces of the book and
its 80 reviews have been removed.
http://jamesfetzer.blogspot.com/2015/11/debunking-sandy-hook-debunk...
https://www.youtube.com/watch?v=E...