It might be the best, if F# automatically overloaded "EvenMore" with a proper member function that forwards calls to the memoized function and that is only visible from non-F#-clients. That would also work for curried functions and wouldn't affect the F# way of doing things (though you couldn't overload the member yourself anymore).

I agree that it would be useful if F# could automatically wrap member function calls inside a function with an explicit first argument taking the object instance.

Best regards,
Stephan

By on 5/30/2008 12:05 AM ()

Just to mention that the code for "EvenMore" has a problem: EvenMore is a property that gets re-evaluated each time it is applied. This means you are re-creating the memoization table each time the property is used. You'll need to lift the memoization table out to a (strict) let-binding.

Thanks

Don

By on 6/7/2008 11:44 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