Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

List.make not tail-recursive #17

Closed
ygrek opened this issue Aug 29, 2015 · 1 comment
Closed

List.make not tail-recursive #17

ygrek opened this issue Aug 29, 2015 · 1 comment
Assignees

Comments

@ygrek
Copy link
Owner

ygrek commented Aug 29, 2015

Originally reported on Google Code with ID 12

# List.make 10000000 1;;  
Stack overflow during evaluation (looping recursion?).
# let make i x =
  let rec loop acc x = function
  | 0 -> acc
  | i -> loop (x::acc) x (i-1)  
  in loop [] x i;;
val make : int -> 'a -> 'a list = <fun>
# make 10000000 1;;
- : int list =
[1; 1; 1; 1; 1; 1; 1; 1; 1; ...]

Reported by apsheronets on 2009-09-07 13:42:11

@ygrek ygrek self-assigned this Aug 29, 2015
@ygrek
Copy link
Owner Author

ygrek commented Aug 29, 2015

Fixed in r383, thanks

Reported by ygrekheretix on 2011-03-06 13:42:18

  • Status changed: Fixed

@ygrek ygrek closed this as completed Aug 29, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant