Structs (IN BETA)

This commit is contained in:
2025-10-04 20:37:55 +10:00
parent b3950dcd62
commit 0057d73215
13 changed files with 322 additions and 10 deletions

27
tests/struct.kyn Normal file
View File

@@ -0,0 +1,27 @@
struct Data {
status = <Bool>
moreCrap = ["dingus", 32]
fun init status moreCrap {
#assert $status is <Bool>
#assert $morecrap is <List>
println "Initing!"
self status = $status
self moreCrap = $moreCrap
println "Done!"
}
fun toString {
return (concat "Status: " (self status))
}
fun testMemberFn {
println "This is from the test member function! Yay!"
}
}
let myData = (Data "true" ["dingus", "dongus", "mingus", "mongus"])
myData testMemberFn
println $myData