Welcome to the CHICKEN Scheme pasting service

how to create an error type? added by kiatoa on Fri Nov 28 06:19:15 2014

megatest> (define (check thunk)
-------->   (condition-case (thunk)
-------->      ((exn file)(print "file error"))
-------->      ((exn timeout)(print "Caught timeout error"))
-------->      (var ()(print "something else"))))
megatest> (check (lambda ()(open-input-file "")))
file error
megatest> (check (lambda ()(signal (make-property-condition 'timeout 'message "Timed out talking to server"))))
something else
megatest> (define (check thunk)
-------->   (condition-case (thunk)
-------->      ((exn file)(print "file error"))
-------->      ((exn 'timeout)(print "Caught timeout error"))
-------->      (var ()(print "something else"))))
megatest> (check (lambda ()(signal (make-property-condition 'timeout 'message "Timed out talking to server"))))

Your annotation:

Enter a new annotation:

Your nick:
The title of your paste:
Your paste (mandatory) :
What's the procedure to access a character in a string by index in R5RS?
Visually impaired? Let me spell it for you (wav file) download WAV