4 ms·
Show HN: I implemented Tilde – Operator for Go Compiler after months of research
- Dentrax 5y agoHey! This is my first attempt to learning of the contribution to Go Compiler. I just wanted to write a blog post about the journey. Your feedbacks are valuable! Thanks! If you do not use Medium, you can read the blog on the repository: https://github.com/Dentrax/go-tilde-operator/ https://github.com/Dentrax/go-tilde-operator/ Find the issue proposal: https://github.com/golang/go/issues/46847 https://github.com/golang/go/issues/46847 Find the implementation PR: https://github.com/golang/go/pull/46848 https://github.com/golang/go/pull/46848
- ezekg 5y agoI've used the tilde operator in Unity + C# quite a bit when mutating bitmasks that store state. For example, my player movement code manages its state within a bitmask. To remove a certain state, I do something like this to ensure the player exits a given state: if ((state.CurrentState & EPlayerState.Sliding) != 0) { state.NextState &= ~EPlayerState.Sliding; } Outside of hobby game dev, I've never used it. From the PR, I'm not sure Go devs want it.