pull/2/head
Matthew Butterick 11 years ago
parent daf1edd1bf
commit f7e4dc7aec

@ -7,7 +7,8 @@
"list.rkt" "list.rkt"
"misc.rkt" "misc.rkt"
"string.rkt" "string.rkt"
"len.rkt") "len.rkt"
"try.rkt")
(provide (provide
(all-from-out (all-from-out
@ -17,4 +18,5 @@
"list.rkt" "list.rkt"
"misc.rkt" "misc.rkt"
"string.rkt" "string.rkt"
"len.rkt")) "len.rkt"
"try.rkt"))

@ -0,0 +1,12 @@
#lang racket/base
(require (for-syntax racket/base))
(provide try)
;; Pythonlike try/except
(define-syntax (try stx)
(syntax-case stx ()
[(_ body ... (except tests ...))
#'(with-handlers (tests ...) body ...)]))
Loading…
Cancel
Save