2024-07-05 00:53:37 +09:00
|
|
|
class Object {
|
|
|
|
}
|
|
|
|
|
2024-07-06 12:16:05 +09:00
|
|
|
class Collection : Object {
|
2024-07-05 00:53:37 +09:00
|
|
|
}
|
|
|
|
|
|
|
|
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)
|
|
|
|
}
|
|
|
|
|
2024-07-16 00:15:28 +09:00
|
|
|
fun Class:name() {
|
|
|
|
return (core.class_name self)
|
|
|
|
}
|
|
|
|
|
2024-07-06 12:16:05 +09:00
|
|
|
class String: Array (a b c) {
|
|
|
|
}
|
|
|
|
|
|
|
|
class String: Array (
|
|
|
|
monaco
|
|
|
|
duncan
|
|
|
|
falcon
|
|
|
|
:deuce
|
|
|
|
:canival
|
|
|
|
:pebble
|
|
|
|
:godzilla
|
|
|
|
) {
|
|
|
|
fun Collection:slice(index count) {
|
|
|
|
return (arr.slice self index count)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-07-05 00:53:37 +09:00
|
|
|
|
|
|
|
printf "string length %d\n" ("aaaa":length)
|