2

我徒劳地试图让类型声明示例与 Clozure CL 一起使用,例如:

(datatype fruit
   if (element? F [apples pears oranges])
   ______________________________________
   F : fruit;)

但我得到的唯一输出是:

type error

好像是Ccl的问题,有没有可能正常运行?

PS:类型检查开启,(tc +)

4

1 回答 1

1

这适用于 QiII1.06SBCL:

(0-) (tc +)
true

(1+) (datatype fruit
       if (element? F [apples pears oranges])
       ______________________________________
       F : fruit;)
fruit : symbol

(2+) apples : fruit
apples : fruit

(3+) steak : fruit
type error

因此,我建议您尝试从网站下载官方捆绑包之一,因为据我所知,目前 CCL 不受官方支持。

于 2011-06-23T15:59:34.177 回答