This is the mail archive of the guile@cygnus.com mailing list for the guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: call-with-current-continuation



> It just so happens that I was reading R4RS just earlier today and
> thinking that call-with-current-continuation looks pretty cool. Then
> I looked at the libguile and found that
> call-with-current-continuation is not supported <sob>.

It's not?

    zwingli:jimb$ guile
    guile> (define call/cc call-with-current-continuation)
    guile> (define mondo-bizarro
      (lambda (x)
	(display 'one)
	(newline)
	(call/cc (lambda (k) (x k)))
	(display 'two)
	(newline)
	(call/cc (lambda (k) (x k)))
	(display 'three)
	(newline)))
    guile> (mondo-bizarro mondo-bizarro)
    one
    one
    two
    one
    three
    guile> 

> I also had a thought about errors... is it currently possible to override
> the `error' procedure with your own error procedure and use this to redirect
> all of the system errors? Is is safe to redefine `error' for some bits of
> code and put back the global value for other sections?

You can use catch with a tag of #t to catch all thrown errors.  I
think that's what you want, no?