Structs (IN BETA)
This commit is contained in:
27
tests/struct.kyn
Normal file
27
tests/struct.kyn
Normal 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
|
||||
Reference in New Issue
Block a user