Slacker News Slacker News logo featuring a lazy sloth with a folded newspaper hat
  • top
  • new
  • show
  • ask
  • jobs
Library
← Back to context

Comment by more_original

14 years ago

Yes, printf is easy in F#. The following example works in F# and OCaml:

  let rec fact n =
     Printf.printf "%i\n" n;
     if n = 0 then 1 else n * (fact (n-1))

0 comments

more_original

Reply

No comments yet

Contribute on Hacker News ↗

Slacker News

Product

  • API Reference
  • Hacker News RSS
  • Source on GitHub

Community

  • Support Ukraine
  • Equal Justice Initiative
  • GiveWell Charities