[plt-scheme] Segfault during debug

From: Paulo J. Matos (pocmatos at gmail.com)
Date: Tue Apr 11 09:31:21 EDT 2006

Hi all,

Using svn from last night...
I tried out from continuation kata:

(define (search-generator lst p?)
  (let ((success '?)) ;; placeholder for the current continuation
    (letrec ((cont-success ;; next continuation
              (lambda (x) (search lst)))
             (search
              (lambda (elem)
                (cond ((null? elem) 'done)
                      ((pair? elem) (search (car elem))
                                    (search (cdr elem)))
                      ((p? elem) (call/cc
                               (lambda (k) ;; next search will
continue from here
                                 (set! cont-success k)
                                 (success elem))))
                      (else 'done)))))
      (lambda () (call/cc (lambda (k)
                       (set! success k)
                       (cont-success 'done)))))))

(define solutions
  (search-generator '(0 ((1 a) 2) b (b c) (((6)))) number?))

The second call to (solutions) fails. That wierd. Wierder is that if
you step through the two (solutions) calls, the second one segfaults.


Cheers,
--
Paulo Jorge Matos - pocm at sat inesc-id pt
Web: http://sat.inesc-id.pt/~pocm
Computer and Software Engineering
INESC-ID - SAT Group


Posted on the users mailing list.