[plt-scheme] call/cc and space

From: Greg Woodhouse (gregory.woodhouse at sbcglobal.net)
Date: Tue Feb 7 15:53:54 EST 2006

--- Matthew Flatt <mflatt at cs.utah.edu> wrote:

> At Tue, 7 Feb 2006 12:18:56 -0800, John Clements wrote:
> > So MzScheme is now safe-for-space?
> 
> No, not in general.
> 
> Matthew
> 

Okay, I'm confused. Is this the sort of code that would be unsafe (I
know it's contrived)?

(define (run)
  (begin
    (display "Welcome to Gendanken")
    (letrec 
        ((main-loop
          (lambda ()
            (begin
              (newline)
              (display ">> ")
              (let ((input-exp (read)))
                (unless (equal? input-exp '(exit))
                  (call/cc
                   (lambda (k)
                     (display
                      (if (equal? input-exp 'skip) (k '()) 'x))))
                  (main-loop)))))))
      ;enter the main loop
      (main-loop))))

===
Gregory Woodhouse  <gregory.woodhouse at sbcglobal.net>
"All truth passes through three stages: First, it is ridiculed.
Second, it is violently opposed. Third, it is accepted as
being self-evident."
--Arthur Schopenhauer


Posted on the users mailing list.