के लिए कारण पर दोषरहित काम करता था:
type Foo(a) =
[<OverloadID("CurriedAbc")>]
member public x.Abc (p:(oneType * anotherType) seq) otherParm = method impl...
//this overload exists for better compatibility with other languages
[<OverloadID("TupledAbc")>]
member public x.Abc (p:Dictionary<oneType, anotherType>, otherParm) =
x.Abc(p |> Seq.map(fun kvp -> (kvp.Key, kvp.Value))) otherParm
इस कोड को निम्नलिखित संकलन-टाइम त्रुटि पैदा करता है
Optimizations for Curried Methods
A curried member looks like this:
type C() =
static member Sum a b = a + b
In previous implementations of F# curried members were compiled less efficiently than non-curried members. This has now been changed. However, there are now some small restrictions on the definition of curried members:
- curried members may not be overloaded
- some definitions of curried members may need to be adjusted to add the correct number of parameters to the definition
के बाद से अपने ओवरलोडिंग पर हल किया जा सकता: परिवर्तन में detailed release notes है शीर्षक मुद्दा ओर इशारा करते हुए के लिए
[<OverloadID("CurriedAbc")>]
member public x.Abc (p:(oneType * anotherType) seq)
= fun otherParm -> method impl...
स्रोत
2009-05-28 13:03:48
धन्यवाद, मैं एक और समस्या है जो मुझे ठीक करने के लिए मिल गया और उसके बाद के लिए एक सवाल लिख रहा था: पहले पैरामीटर पर ly, आप के लिए curried संस्करण बदलकर दौर काम करने के लिए सक्षम होना चाहिए यह एक आया और मैं सिर्फ शीर्षक के बारे में भूल गया :( पीएस: मैं अभी यह देखने के लिए अपने समाधान का परीक्षण कर रहा हूं कि यह काम करता है या नहीं: डी – em70