2 ms·
Kind of an annoying point but I'm tired of seeing factorial-like functions as the first demos of PL sites. It does nothing to explain how the language works, wh
by junon 5y ago
Kind of an annoying point but I'm tired of seeing factorial-like functions as the first demos of PL sites. It does nothing to explain how the language works, what it looks like, what any defining/unique features are, what the standard library - if any - might have included, etc.
- Jtsummers 5y agoActually, it does here. Definitions with let in OCaml are not recursive. let rec permits you to have recursive definitions. A simple numeric function is probably the fastest way to show something that a user can type in that illustrates how you'd write a simple recursive function.
- yawaramin 5y agoThe site is on GitHub--feel free to send a PR if you have a better suggestion!