How about making the function a static member of the type? If necessary, you can still define an external function that forwards all calls to the static function.

Stephan

By on 9/23/2008 1:12 PM ()

Yes; unfortunately there is not yet any way in the language to do this directly. Here's the explicit version of the suggested workaround:

1
2
3
4
5
6
7
#light

type Bar = 
    Bar of int 
        member x.bar = Bar.foo()
        static member foo() = System.Console.WriteLine("foo") 
let foo() = Bar.foo()
By on 9/23/2008 2:19 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