Well if you want to define a member it should have this form:

1
type Foo =  abstract Bar : 'a -> 'b

But I do not understand how you would like to use it in this case as a property seems perfectly suitable.

By on 2/9/2009 11:25 PM ()

Thank you,brilsmurf.
If I want to define IConnectionService interface that includes a event named Disconnect.

1
2
interface IConnectionService
    event DisconnecEventHandler Disconnect

How to define the interface in F#? By the way, DisconnectEventHandler is a custom delegate type.

By on 2/9/2009 11:32 PM ()

The language spec says.

Event declarations are not built-in to the F# language, and event is not a keyword. However, properties whose
type coerces to Microsoft.FSharp.Control.IDelegateEvent<_> are compiled to include extra .NET
metadata and methods that mark the property name as a .NET event.

But Im as unsuccessfull as you in actually getting it to work using 1.9.6.2.

By on 2/9/2009 11:37 PM ()

Maybe it' will support the event keyword in the furthure.
It's trouble that interacting with C#. Programmer must declare a new delegate handler afresh. It's not comfortable.

By on 2/12/2009 9:46 PM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper