This commit is contained in:
		
							
								
								
									
										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) | ||||
		Reference in New Issue
	
	Block a user