All structs fields are public and currently I only use destructuring a way of getting the value stored in any known field. I'm thinking of simplifying the process a bit, by intoducing pointer access using the ->. Think about it, all objects in java are heap allocated and variables store references (So variables are actually pointers in this case) to those objects, so it makes sense.
struct Foo(baz: Int)
fun main(): Unit => {
var bar = Foo { baz: 100 }
println(bar->baz)
}
All structs fields are public and currently I only use destructuring a way of getting the value stored in any known field. I'm thinking of simplifying the process a bit, by intoducing pointer access using the ->. Think about it, all objects in java are heap allocated and variables store references (So variables are actually pointers in this case) to those objects, so it makes sense.