You could put this is a module to have pervasive access to the interfaces:

1
2
3
4
type ICar with member x.ICar = x

type IGirl with member x.IGirl = x
By on 1/29/2009 1:32 AM ()

Brian - that's something I overlooked.

brilsmurf - nice suggestion.

The only problem is that the property ICar appears recursively e.g.

1
my.ICar.ICar.ICar.Make

is defined which could be confusing. Applying the type extension to the class gets round this:

1
type Life with member x.ICar = x :> ICar

I believe this would be hidden when used from other .NET languages, so is probably the best solution here.

By on 1/29/2009 10:54 AM ()

This will look a little weird if you try to consume the type from other .Net languages like C#.

By on 1/28/2009 7:39 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