當在打字球拍中定義結構體時,我不能再使用prop:procedure
。在正常球拍我可以這樣做:無法應用道具:打字球拍中的程序
(struct profile-unit (a t c g)
#:property prop:procedure (thunk* 12))
(define t (profile-unit .1 .1 .2 .6))
(t)
> 12
但是,當我嘗試在類型化/球拍,我得到一個類型檢查錯誤:
(struct profile-unit ([a : Real] [t : Real] [c : Real] [g : Real])
#:property prop:procedure (thunk* 12))
(t)
> Type Checker: Cannot apply expression of type profile-unit, since it is not a function type in: (t)
是否有輸入球拍定義這個屬性的另一種方式?
不再像在'#lang typed/racket'中工作過嗎? – Sylwester
'thunk *'現在也不會在類型化的球拍中進行類型檢測 –