存在类型 (existential type)
2023-07-06
存在类型(existential type), 表示某个类型存在, 设Trait A, 则some A表示存在某个类型符合A特征;
与存在类型相对应的为任意类型, any A表示负责A特征的任意类型.
540 字
|
3 分钟
多态 (polymorphism)
2023-07-06
多态 (polymorphism) 指为不同数据类型的实体提供统一的接口, 或使用一个单一的符号来表示多个不同的类型.
511 字
|
3 分钟