updated the kernel class initialization to set the superclass
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-07-29 15:36:07 +09:00
parent e4a26b71be
commit 7252ee5e47
4 changed files with 234 additions and 8 deletions

View File

@ -10,21 +10,25 @@ class Collection :: Object {
class IndexedCollection :: Collection {
}
class FixedSizedCollection :: Collection {
class FixedSizedCollection :: IndexedCollection {
}
class Array :: FixedSizedCollection {
}
class String :: Array {
class String :: FixedSizedCollection {
}
fun Collection:length() {
return (arr.length self)
return (core.length self)
}
fun Collection:slice(index count) {
return (arr.slice self index count)
return (core.slice self index count)
}
fun Collection:at(index) {
return (core.get self index)
}
fun Class:name() {
@ -50,3 +54,5 @@ fun Class:name() {
printf "string length %d\n" ("aaaa":length)
printf "substring [%s]\n" ("abcdefghijklmn":slice 5 6)
printf "substring [%c]\n" ("abcdefghijklmn":at 14)