31 lines
375 B
HCL
31 lines
375 B
HCL
|
class Object {
|
||
|
}
|
||
|
|
||
|
class Collection: Object {
|
||
|
}
|
||
|
|
||
|
class IndexedCollection: Collection {
|
||
|
}
|
||
|
|
||
|
class FixedSizedCollection: Collection {
|
||
|
}
|
||
|
|
||
|
class Array: FixedSizedCollection {
|
||
|
}
|
||
|
|
||
|
class String: Array {
|
||
|
}
|
||
|
|
||
|
fun Collection:length() {
|
||
|
return (arr.length self)
|
||
|
}
|
||
|
|
||
|
fun Collection:slice(index count) {
|
||
|
return (arr.slice self index count)
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
printf "string length %d\n" ("aaaa":length)
|