Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.lisp
Lisp in Small Pieces (call/cc
William James
12/30/2015 9:44:00 AM
(define (fact n)
(let ((r 1) (k 'void))
(call/cc (lambda (c) (set! k c) 'void))
(set! r (* r n))
(set! n (- n 1))
(if (= n 1) r (k 'recurse))))
MatzLisp (Ruby):
require 'continuation'
def fact n
r = 1; k = nil
callcc{|c| k = c}
r *= n
n -= 1
k.call if n > 1
r
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...
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
Lisp in Small Pieces (call/cc
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password