Hi,

Here are different possibilities.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
type IFoo =
    abstract Boo: (int * int * int) -> unit

type Foo() =
    interface IFoo with
       member x.Boo tuple = 
          ()

let test_foo (foo:IFoo) = 
    foo.Boo((10, 10, 10))

 

type IFoo2 =
    abstract Boo: int -> int -> int -> unit

type Foo() =
    interface IFoo2 with
       member x.Boo x y z = 
          ()

let test_foo (foo:IFoo2) =
    foo.Boo 10 10 10

 


type IFoo3 =
    //method Boo takes x y z parameters and returns nothing
    abstract Boo: int * int * int -> unit

type Foo() =
    interface IFoo3 with
       member x.Boo(x, y, z) = 
          ()

let test_foo (foo:IFoo3) = 
    foo.Boo(10, 10, 10)

Laurent.

By on 4/23/2008 9:10 AM ()

Hi LLB,

Thanks for quick answer. It works! So easy!

It looks like I still confusing of so rich syntax (many contructions which the language supports) and still don't "feeling" them. Need more practice :)

By on 4/23/2008 9:32 AM ()

Another example:

type IFoo=
//method Boo takes a tuple x*y*z parameters and returns nothing
abstract Boo: int*int*int->unit

type Foo() =
interface IFoo with
x.Boo x,y,z =
()

error: only simple variable patterns can be bound in 'let rec' constructs.

By on 4/23/2008 8:41 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