This might not answer your question directly, but what you *could* do, would be to create two interfaces. So, your first interface would be:

1
2
3
type c0 = interface 
 abstract f : int -> int
end;;

And, then you could extend the interface c0 to make the interface c2.

The object c1, then, would represent an *implementation* of c0.

By on 3/31/2008 12:54 PM ()

Hi Keiko,

I don't think you can, I think the limitation here is .NET rather than F#. Your not allowed to partially implement an interface you must give a definition for all members. You could provide a "virtual" implentation that raises an exception informing uses of the class they need to override the method and provide an implentation.

Cheers,
Rob

By on 3/31/2008 8:18 AM ()

Hello Robert and LarsJo.

It is a little counter-intuitive that I cannot partially implement interfaces,

while a similar scenario works with classes with abstract members.

Anyway, thank you for the replies.

Best,

Keiko

By on 4/1/2008 5:15 AM ()
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