What would the type of 'foo' be? As described, it would take an infinite number of curried arguments (e.g. a function that takes an int, and returns a function that takes an int, and return a ...)

You can always do this:

1
2
3
4
5
6
7
8
 
type X() =
  member this.foo (a:int) =
    printfn "%d" a
    this

let x = new X()
x.foo(1).foo(2).foo(3) |> ignore

to break the direct recursion with an intermediate object type.

(Do a quoted reply to my message to see the bbcode.)

By on 4/9/2009 12:55 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