Hi Chuck,
You've captured in one place so many of the language features that I've wanted. Thanks! I'm thinking about doing a decent sized project in Cobra, but I have two questions:
1) do you have a time frame as to when you'll have first-class functions?
2) can you post a simple example of a Windows form with a button and a click event handler? I;ve got a form working, but I'm not clear on how to get the listen stmt to work with it.
Thanks.
Forums
how to use listen stmts
6 posts
• Page 1 of 1
Re: how to use listen stmts
You're welcome.
Time frame on first-class functions: probably last week of Feb or first week of March. I'd like to have them done by yesterday, but there a few bugs to squash and some source to open.
WinForms example. I'll try to get to this later today, but maybe it would help if I published the existing test case so you can at least see the syntax in a program that executes.
Time frame on first-class functions: probably last week of Feb or first week of March. I'd like to have them done by yesterday, but there a few bugs to squash and some source to open.
WinForms example. I'll try to get to this later today, but maybe it would help if I published the existing test case so you can at least see the syntax in a program that executes.
use System.ComponentModel
class Test
var _visited as bool
def main is shared
Test().run
def run
assert not _visited
using c = Component()
listen c.disposed, ref .componentDisposed
assert _visited
_visited = false
using c = Component()
listen c.disposed, ref _componentDisposed
assert _visited
def componentDisposed(sender as Object, args as EventArgs)
_visited = true
def _componentDisposed(sender as Object, args as EventArgs)
_visited = true
- Charles
- Posts: 2515
- Location: Los Angeles, CA
Re: how to use listen stmts
Time frame on first-class functions: probably last week of Feb or first week of March. I'd like to have them done by yesterday, but there a few bugs to squash and some source to open.
Hi,
Is this first-class functions already implemented? I browsed the docs but couldn't find any info.
- jonathandavid
- Posts: 159
Re: how to use listen stmts
For starters see:
-- How To Pass References to Methods
-- How To Use Win Forms
For storing references to methods in variables, or taking them as parameters, see:
-- Cobra 0.7.4 Release Notes
If you have a Subversion workspace, you can browse test cases under <workspace>\Tests\220-delegates-etc
If you have further questions after reviewing the above material, let us know.
-- How To Pass References to Methods
-- How To Use Win Forms
For storing references to methods in variables, or taking them as parameters, see:
-- Cobra 0.7.4 Release Notes
If you have a Subversion workspace, you can browse test cases under <workspace>\Tests\220-delegates-etc
If you have further questions after reviewing the above material, let us know.
- Charles
- Posts: 2515
- Location: Los Angeles, CA
Re: how to use listen stmts
Chuck wrote:For starters see:
-- How To Pass References to Methods
-- How To Use Win Forms
For storing references to methods in variables, or taking them as parameters, see:
-- Cobra 0.7.4 Release Notes
If you have a Subversion workspace, you can browse test cases under <workspace>\Tests\220-delegates-etc
If you have further questions after reviewing the above material, let us know.
Thanks. What about other features of functional programming such as currying, lambdas, closures? Any plans for implementing those?
BTW, I really like what I've seen of Cobra so far. I plan to start a little project using Cobra soon, I'll keep you informed of any bugs or suggestions that pop up.
- jonathandavid
- Posts: 159
Re: how to use listen stmts
I definitely plan on implementing lambdas and closures. Not planning on implementing currying at this time.
Feedback is always appreciated.
Be sure to use Cobra out of the source code repository. There is a handy install-from-workspace script in the Source directory and we have an extensive automated regression test suite, so it tends to be fairly stable.
-Chuck
Feedback is always appreciated.
Be sure to use Cobra out of the source code repository. There is a handy install-from-workspace script in the Source directory and we have an extensive automated regression test suite, so it tends to be fairly stable.
-Chuck
- Charles
- Posts: 2515
- Location: Los Angeles, CA
6 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 45 guests