문제

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")
도움이 되었습니까?

해결책

You need the conditions library:

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

yields

=> #f
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top