Re: [racket] with-handlers string->xexpr fail

2010-10-22 Thread scouic
i've understood, big thanks for your help ! have a nice day, -mw _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users

Re: [racket] with-handlers string->xexpr fail

2010-10-22 Thread David Van Horn
On 10/22/10 5:38 PM, scouic wrote: I thought invalid-xexpr?was necessarily a boolean returning # t or # f ... thank you very much for your explanation David exn:invalid-xexpr? is a predicate: it's a function that can be applied to any value and it will return either #t or #f. It returns #t on

Re: [racket] with-handlers string->xexpr fail

2010-10-22 Thread scouic
I thought invalid-xexpr? was necessarily a boolean returning # t or # f ... thank you very much for your explanation David _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users

Re: [racket] with-handlers string->xexpr fail

2010-10-22 Thread David Van Horn
On 10/22/10 5:12 PM, scouic wrote: Hi, i learn with-handlers mechanism, and i don't understand what's wrong in this piece of code ? #lang racket (require xml) (define a-good-string "hi there!") (define a-bad-string "hi there!") (define (panoramix s) (with-handlers ((exn:invalid-xexpr? (lamb

[racket] with-handlers string->xexpr fail

2010-10-22 Thread scouic
Hi, i learn with-handlers mechanism, and i don't understand what's wrong in this piece of code ? #lang racket (require xml) (define a-good-string "hi there!") (define a-bad-string "hi there!") (define (panoramix s) (with-handlers ((exn:invalid-xexpr? (lambda (e) 'UFO))) (string->xexpr s)))