Regarding syntax, you need a 'this' to call a member. Here are a couple ways:

1
2
3
4
5
6
7
8
9
10
11
12
 

type SomeClass1 =
    val someInt : int
    member this.someFunc x = x
    new (x) as this = {someInt = this.someFunc x}

type SomeClass2(x) as this =
    let someInt = this.someFunc(x)
    member this.someFunc x = x

Of course, neither of these work at runtime, because you can't call members until the object has been constructed. Maybe you want a static member function?

By on 2/21/2010 12:32 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