Research : Mondo Bizarro - urschleim/scream GitHub Wiki

Mondo Bizarro

The code below is a complex example of continuation usage, scream is currently not able to execute it successfully. See #202

1 : (define (mondo-bizarro)
2 :   (let ((k (call-with-current-continuation (lambda (c) c))))
3 :     (display 1)
4 :     (call-with-current-continuation (lambda (c) (k c)))
5 :     (display 2)
6 :     (call-with-current-continuation (lambda (c) (k c)))
7 :     (display 3)))

=> 11213 (Chez)

Prompts

  • Erkläre mir die Eigenschaften einer Scheme continuation.
  • Wird auch das Environment zurückgesetzt?

Bizarre steps

2 :
assign k = c2 | e{}  CENV = empty
                     CENV = c2{}

3 :
print "1"

4 :
exec k( c4{ k=c2{} } )

2 : 
assign k = c4{ k=c2{} }  CENV = k = c4{ k=c2{} }

3 :
print "1"

4 :
exec k(  )