[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
No ending loop occured when using call-with-current-continuaion
From: |
Ying Luo |
Subject: |
No ending loop occured when using call-with-current-continuaion |
Date: |
Fri, 21 Sep 2001 11:24:59 +0800 |
Hi,
When I type commands listed below interactively into guile(not using
"load"), I found there is a loop without ending occured.
(define call/cc call-with-current-continuation)
(define retry #f)
(define factorial
(lambda (x)
(if (= x 0)
(call/cc (lambda (k) (set! retry k) 1))
(* x (factorial (- x 1))))))
(begin (display (factorial 4))
(newline)
(display (retry 1))
(newline))
Would you please give me some advice? Thanks a lot!
Best Regards,
Luo Ying
- No ending loop occured when using call-with-current-continuaion,
Ying Luo <=