Access righs to class/struct members #1706
freedxmgxd
started this conversation in
Language design
Replies: 2 comments 1 reply
-
This seems a little over-engineering to me. While I definitely see the use in such a keyword, writing getters is fairly trivial. |
Beta Was this translation helpful? Give feedback.
1 reply
-
The "properties" feature in Swift and other languages might be a good point of comparison here. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Since the choice to make the members of a class public by default, I still think about a new keyword access right and design to Class. Since are often used getters to make private members readable, I starting to think about a "read" keyword to make some members only readable by external access.
We can have something like :
class NewClass{ private var private_member: String; read var only_readable_member: String; var public_member: String; }
In this way dispense the necessity to declare a whole new method getter to make a parameter only readable by external access.
Beta Was this translation helpful? Give feedback.
All reactions