1 karma · joined Nov 9, 2026 (3w ago) · 4 submissions
comment 3w ago · link · parent
I'm the type of person that uses getters and setters for everything, I don't really like public fields so I naturally do that in Rust too. But of course it doesn't work well, Rust doesn't know that a pos_mut() and rot_mut() return inner fields, so it simply doesn't allow you to call both functions together.
Thinking about this for a long time, I came to the conclusion: Why doesn't the function mention which field the returned reference is from? If the function says that pos_mut() is "attached" to the pos field, and rot_mut() is "attached" to the rot field, then the compiler would be able to distinguish both references by the function call.
That initial idea became what I now call the "Ties" concept in the Dazzle programming language, which I've been designing. It's on a very early stage but so far it's proving my point. I would love to hear some feedback, especially some situations where this approach may fall short. Thanks
comment 3w ago · link · parent
comment 3w ago · link · parent