Created
July 21, 2012 21:17
-
-
Save chribben/3157217 to your computer and use it in GitHub Desktop.
Build lists using append and cons
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let rec buildAppend (lst:int list) num = | |
if lst.Length < 30000 then | |
buildAppend (lst @ [num]) num | |
else | |
lst | |
let rec buildCons (lst:int list) num = | |
if lst.Length < 30000 then | |
buildCons (num::lst) num | |
else | |
List.rev lst |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment