Forums
Event declarations and firing Events
23 posts
• Page 3 of 3 • 1, 2, 3
Re: Event declarations and firing Events
I fixed the bug you reported above about the argless "init" not being found if "init" was overloaded.
- Charles
- Posts: 2515
- Location: Los Angeles, CA
Re: Event declarations and firing Events
I think Cobra should also allow an event decl in a single line like so:
And the "listen" statement should accept a method with more narrow arguments such as "sender as Button" instead of "sender as Object".
Both these ideas come straight out of Visual Basic. Their merit is convenience.
A further idea for consideration is the "handles" syntax from VB.
class Button
event click(sender as Object, args as MyEventArgs)
# instead of:
sig ClickHandler(sender as Object, args as MyEventArgs)
event click as ClickHandler
And the "listen" statement should accept a method with more narrow arguments such as "sender as Button" instead of "sender as Object".
Both these ideas come straight out of Visual Basic. Their merit is convenience.
A further idea for consideration is the "handles" syntax from VB.
- Charles
- Posts: 2515
- Location: Los Angeles, CA
Re: Event declarations and firing Events
Agree about the added convenience of the merged event+sig syntax.
The narrowed 'listen' args seems to already work providing the sig is in sync.
(is that what you mean - allowing the sig params to be more generic than (assignable from) the actual handler params ?
No opinion on the VB-like 'handles' syntax
The narrowed 'listen' args seems to already work providing the sig is in sync.
(is that what you mean - allowing the sig params to be more generic than (assignable from) the actual handler params ?
No opinion on the VB-like 'handles' syntax
- hopscc
- Posts: 632
- Location: New Plymouth, Taranaki, New Zealand
23 posts
• Page 3 of 3 • 1, 2, 3
Who is online
Users browsing this forum: No registered users and 15 guests