0

The manual on standard libraries for Scheme r6rs suggests that if I import the library (rnrs exceptions (6)) I should be able to call (error? val) to check if a given value is an &error type. I want to do this for unit testing. I've added the library to my import header and the code compiles, so I know the import is working fine. But DrRacket still recognizes error? as undefined. Does anyone know what's going on here?

My code:

#!r6rs
(import (rnrs base) (rnrs exceptions (6)))
(error? "hello world")
Reggie
  • 413
  • 2
  • 9
  • 19

1 Answers1

1

You need the conditions library:

#!r6rs
(import (rnrs) (rnrs conditions))
(display (error? "hello world"))

yields

=> #f
uselpa
  • 18,732
  • 2
  • 34
  • 52
  • Ah, I needed (rnrs conditions) not (rnrs exceptions). Thank you!! – Reggie Feb 08 '14 at 23:27
  • 2
    In DrRacket, position the cursor on the word `error?` and press F1. The first help item says `error? provided from rnrs/conditions-6`. – uselpa Feb 08 '14 at 23:53