Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
文档说eval返回any......我有一个案例必须知道是否eval失败..如何测试这个?
eval
any
就像@leppie 说的那样,你照常做。这是一个例子:
(define (eval* expr) (with-handlers ([exn? (λ (e) `(fail ,(exn-message e)))]) `(success ,(eval expr))))
另请参阅沙盒库以更好地控制评估,并且(一如既往)注意使用eval.