thank you for your replying
does call/cc always working with let/ec?
when it comes to compare with your code, it looks like..
call/cc is meaning of "get out of this function and evaluate next function
and comeback (to inside of let/ec) for evaluate rest of the code"
is it right?

if so, I don't understand why

following code does not working properly
#lang scheme

(require racket/gui)

(define (aa) #t #f "11")

(dynamic-wind
 (lambda () (display "in "))
 (lambda ()
   (display "pre ")
   (let/ec out

     (display (call/cc out)))
   (display "1")
   (display "2")
   (display "3")
   )
 (lambda () (display "out ")))

but the following code works weird
#lang scheme
(require racket/gui)
(define (aa) #t #f "11")
(dynamic-wind
 (lambda () (display "in "))
 (lambda ()
   (display "pre ")
   (let/ec out
     (display (call/cc out)))
   (display "1")
   (display "2")
   (display "3")
   "1")
 (lambda () (display "out ")))


2010년 10월 18일 오후 7:59, Jos Koot <[email protected]>님의 말:

>  Compare yoiur code with:
>
> #lang scheme
>
> (require racket/gui)
>
> (dynamic-wind
>  (lambda () (display "in "))
>  (lambda ()
>    (display "pre ")
>    (let/ec out
>
>      (display (call/cc out)))
>    #f)
>  (lambda () (display "out ")))
>
> Jos
>
>  ------------------------------
> *From:* [email protected] [mailto:
> [email protected]] *On Behalf Of *???
> *Sent:* 18 October 2010 12:41
> *To:* [email protected]
> *Subject:* [racket] how does call/cc and let/ec exactly works?
>
>  hello
> I am thinking of such a code like..
> #lang scheme
> (require racket/gui)
> (let ([v (let/ec out
>                (dynamic-wind
>                 (lambda () (display "in "))
>                 (lambda ()
>                   (display "pre ")
>                   (display (call/cc out))
>                   #f)
>                 (lambda () (display "out "))))])
>       (when v (v "post ")))
>
> but I still have no idea how
> "in pre out in post out " is printed but not "in pre out in pre post out "
> how does call/cc and let/ec exactly works?
>
>
_________________________________________________
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/users

Reply via email to