How about Adding/Overloading Some Operators for Signal to Make Signal Operations More Readable #8046
Replies: 2 comments 1 reply
-
We prefer keywords and methods rather than symbolic operators. There are a few exceptions ( Perhaps the |
Beta Was this translation helpful? Give feedback.
-
Please only open either a discussion or a issue for a proposal, closing this as the issue has more information/discussion |
Beta Was this translation helpful? Give feedback.
-
(I don't know if hers is a good place to talk about it, nor do i make it clear that if someone has mentioned this idea before)
As is known to all, signals are now belong to a native class Signal, which allows us to directly connect them to methods (Callables).
However, most of times we are prefer to use a operator to connect signal, just like how it is done in C#.
My thought is to add some operators like "==>" to be meant as "connect()[without flags]", "=/=" as "disconnect()" and "=?=" as "is_connected()".
For example
If we need to pass in a flag, we can add a method
bind_flags()
for a SignalWhen it comes to signal emission, we can use an operator
++
to mean "emit", and add a methodbind_params()
to make it emitted with parametersDevelopers are still allowed to use methods to connect, disconnect, emit and check signals
How do you like this idea? Please share yours in this post :)
Beta Was this translation helpful? Give feedback.
All reactions