Replies: 2 comments 2 replies
-
You first described the way you might currently use selector call expressions, and then skipped directly to describing "solutions". Can you describe what the problem it is that you're trying to "solve"? |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
At the moment there are 3 steps necessary to use the syntax sugar of selector call expressions "->":
See example below:
Solution 1):
Allow default values in the struct for all types. This would reduce Pt. 3) above.
Solution 2):
Use the definition/implementation of the proc outside a struct as a member ot the sruct, if the first parameter in the proc is a pointer to a struct in the package . This would reduce Pt. 1 and Pt. 3.
I think Solution 2) would offer benefits without to break consistency and it is not an typical OO-design. You can still use the proc in common way. The first parameter name "this" could be mandatory if it fits design of Odin.
Beta Was this translation helpful? Give feedback.
All reactions