2
我遇到了一個問題,如果結構是用合同導入的,我無法在場所通道中發送預製結構。這裏有一個完整的例子:球拍 - 無法通過位置通道發送預製結構當它有一個合同
#lang racket
(module structs racket
(provide
example-without-contract
(contract-out [struct example-with-contract ([thing string?])]))
(struct example-without-contract (thing) #:prefab)
(struct example-with-contract (thing) #:prefab))
(require 'structs)
(displayln (format "Can send example-without-contract: ~A"
(place-message-allowed? (example-without-contract "abc"))))
(displayln (format "Can send example-with-contract: ~A"
(place-message-allowed? (example-with-contract "abc"))))
球拍6.8,這個打印:
Can send example-without-contract: #t
Can send example-with-contract: #f
沒有什麼在提到合同documentation。這是一個實際的限制,如果是這樣,有什麼辦法可以解決它嗎? (我猜想只是創建另一個通過頻道發送的結構)。
由於合同本身無法通過地方渠道發送,這是有道理的,我認爲有合同結構附屬於它也無法通過地點頻道發送。我不相信有辦法解決這個問題。 –