5.4.4 The ObjectRange class

优质
小牛编辑
144浏览
2023-12-01

继承自 Enumerable

用上、下边界描述一个对象区域。

PropertyTypeKindDescription
start(any)instancerange的下边界
end(any)instancerange的上边界
exclusiveBooleaninstance决定边界自身是不是range的一部分。
MethodKindArgumentsDescription
[ctor](start, end, exclusive)constructorstart: the lower bound, end: the upper bound, exclusive: include the bounds in the range?创建一个range对象,从start生成到end,这里要注意的是,start和end必段类型一致,而且该类型要有succ()方法。
include(searchedValue)instancesearchedValue: value that we are looking for检查一个value是不是在range中。