0
ラケットはnon-empty-listof
と契約していますが、non-empty-hashof
と契約していません。それを構築する方法はありますか?空ではないハッシュテーブルの契約方法
ラケットはnon-empty-listof
と契約していますが、non-empty-hashof
と契約していません。それを構築する方法はありますか?空ではないハッシュテーブルの契約方法
述語はそう、契約として使用することができます。
(define (non-empty-hash? x)
(and (hash? x)
(not (hash-empty? x))))
次に、あなたの契約としてnon-empty-hash?
使用することができます。
オリジナルQ/A:https://groups.google.com/d/msg/racket-users/KGZeQtUYKUw/3cw9ExtUBwAJ –