关于 standard libraries for Scheme r6rs 的手册建议如果我导入库 (rnrs exceptions (6))
我应该能够调用 (error?val)
来检查给定值是否为 &error
类型。我想为单元测试做这个。我已将该库添加到我的导入 header 中并且代码已编译,所以我知道导入工作正常。但是 DrRacket 仍然将 error?
识别为未定义。有谁知道这里发生了什么?
我的代码:
#!r6rs
(import (rnrs base) (rnrs exceptions (6)))
(error? "hello world")
最佳答案
您需要条件
库:
#!r6rs
(import (rnrs) (rnrs conditions))
(display (error? "hello world"))
产量
=> #f
关于testing - 在 Scheme 中如何检查一个值是否为 "error"类型?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21652417/