Replies: 4 comments 4 replies
-
Thank you for including us in the discussion. Question: the first property in the struct has neither IMHO The best approach would be to answer the question:
How do you want to differentiate
|
Beta Was this translation helpful? Give feedback.
-
Shame on them :D This is a design decision, like if a variable is always immutable or not... |
Beta Was this translation helpful? Give feedback.
-
I think i will settle down on this syntax: class A {
my_public_prop_1: i32;
my_public_prop_2: i32 = 5;
- my_private_prop: i32; // Private
~ my_readonly_prop: i32; // Readonly
trait MyTrait;
fn my_public_func() {
return this.my_pub_prop;
}
- fn my_private_func() {
return this.my_private_prop;
}
static fn my_public_static_func() String {
return "";
}
- static fn my_private_static_func() String {
return "";
}
}
trait MyTrait {
// properties & functions
new_prop: u32;
- new_private_prop: u32;
fn another_func() {
}
}
extend A {
// functions & traits
// traits are not allowed to add more properties when using extend
} |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
New syntax for classes, structs & traits.
-
for private and+
for readonly.extend
to add more functions to a class.Beta Was this translation helpful? Give feedback.
All reactions