This commit is contained in:
parent
86ea4e7071
commit
36b83c63e7
30
src/kernel.hcl
Normal file
30
src/kernel.hcl
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
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)
|
Loading…
Reference in New Issue
Block a user