From 36b83c63e717ee15a369f27a0573ee62f3f8d529 Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Fri, 5 Jul 2024 00:53:37 +0900 Subject: [PATCH] adding some hcl code --- src/kernel.hcl | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 src/kernel.hcl diff --git a/src/kernel.hcl b/src/kernel.hcl new file mode 100644 index 0000000..037c331 --- /dev/null +++ b/src/kernel.hcl @@ -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)