let rec rev_append x y = match x with [] -> y | h :: t -> rev_append t (h :: y) ;; let rev x = let rec rev_int x accum = match x with [] -> accum | h :: t -> rev_int t (h :: accum) in rev_int x [] ;; let lappend x y = rev_append (rev x) ( [ y ] ) ;; let makelist c = let rec makelist_int c accum = if (c > 0) then makelist_int (c - 1) (lappend accum c) else (lappend accum c) in makelist_int c [] ;; let _ = makelist 5000;;