मुझे लगता है कि यह formatting module में एक बग है जो F # इंटरएक्टिव को सुंदर प्रिंटिंग का ख्याल रखता है।
कुछ गैर-पूंछ रिकर्सिव फ़ंक्शन हैं जो PrintLength
उदा। इस line में boundedUnfoldL
।
let boundedUnfoldL
(itemL : 'a -> layout)
(project : 'z -> ('a * 'z) option)
(stopShort : 'z -> bool)
(z : 'z)
maxLength =
let rec consume n z =
if stopShort z then [wordL "..."] else
match project z with
| None -> [] // exhaused input
| Some (x,z) -> if n<=0 then [wordL "..."] // hit print_length limit
else itemL x :: consume (n-1) z // cons recursive...
consume maxLength z
मैं क्यों यह मोनो पर उड़ा नहीं है पता नहीं है: boundedUnfoldL
का कार्यान्वयन वास्तव में पूंछ पुनरावर्ती नहीं है। यह आश्चर्यजनक होगा कि मोनो पर एफ # इंटरएक्टिव लंबाई> 5000 सफलतापूर्वक संभाल सकता है।
आप इसे https://visualfsharp.codeplex.com/workitem/list/basic पर एक बग के रूप में रिपोर्ट कर सकते हैं।
एफ # इंटरएक्टिव की तरह लगता है कि https://fslang.uservoice.com/forums/245727-f-language/suggestions/5663074-enable-a-compiler-warning-when-a-recursive-algorit – Asik