Penso che questo sia un bug nel formatting module che si occupa di una bella stampa su F # Interactive.
Esistono alcune funzioni ricorsive non tail che utilizzano PrintLength
ad es. boundedUnfoldL
in questo line. L'attuazione del boundedUnfoldL
effetti non è ricorsiva in coda:
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
Non so perché non saltare in aria su Mono. Sarebbe sorprendente se F # Interactive su Mono possa gestire con successo la lunghezza> 5000.
È possibile segnalare questo come un errore a https://visualfsharp.codeplex.com/workitem/list/basic.
Suoni come l'F # Interactive trarrebbero vantaggio da https://fslang.uservoice.com/forums/245727-f-language/suggestions/5663074-enable-a-compiler-warning-when-a-recursive-algorit – Asik