|Anonymous | Login | Signup for a new account||2016-06-26 03:07 CEST|
|Main | My View | View Issues | Change Log | Roadmap|
|View Issue Details|
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0004989||OCaml||OCaml general||public||2010-03-01 13:16||2010-04-18 10:53|
|Target Version||Fixed in Version|
|Summary||0004989: Compiler rejects recursive definitions of values|
|Description||Compiler rejects thw following definition:|
# let rec f = let g = fun x -> f x in g;;
Error: This kind of expression is not allowed as right-hand side of `let rec'
However, the following definition is OK:
# let rec f = let g = f in fun x -> g x;;
val f : 'a -> 'b = <fun>
It seems that the first definition is also OK according to the reference manual (section 7.3).
|Tags||No tags attached.|
The checking of recursive value definitions is syntactic in nature and rather subtle. In your case, the criteria used do not distinguish between your example and "let rec f = let g = f in g", which would be semantically ill-defined indeed (just like "let rec f = f").
I'll keep this PR as a feature wish, but I'm afraid it's not going to be addressed any time soon.
|2010-03-01 13:16||hattori||New Issue|
|2010-04-18 10:53||xleroy||Note Added: 0005319|
|2010-04-18 10:53||xleroy||Severity||minor => feature|
|2010-04-18 10:53||xleroy||Status||new => acknowledged|
|Copyright © 2000 - 2011 MantisBT Group|