by fleitz · 15y ago · 0 comments
It lets you define the name of the this parameter in exactly the same way you pass it.
type Bar(p) =
member x.Foo(bar) = printf "%s %d" bar p
let x = new Bar(10)
x.Foo("Foo bar")
Output: Foo bar 10
And yes, the variables bar and p are type inferred from the %s and %d respectively class Flip(object):
foo=4
def flop(x,num):
x.bar=x.foo+num