3 ms·
> This might be entirely superficial of me, but I always preferred Haskell over OCaml simply because OCaml required me to type ";;" after every line. That's ea
by avsm 13y ago
> This might be entirely superficial of me, but I always preferred Haskell over OCaml simply because OCaml required me to type ";;" after every line.
That's easily fixed: only the toplevel requires ;; (to commence evaluation of the phrases you've typed in). Just don't use it in normal code and everything will parse fine.
- andrewflnr 13y ago> everything will parse fine. That's an exaggeration. There are circumstances in files where it's necessary. I didn't realize this, which hung me up for a long time.
- silentOpen 13y agoDon't put non-let expressions at the top level?
- jon_smark 13y agoWould you care to share an example? I've never encountered a justifiable need to write ;; outside the REPL. The only uses of ;; I've encountered "in the wild" were hardly reasonable: essentially top-level code that was not wrapped in a "let () = ..." statement.
- andrewflnr 13y agoI don't recall seeing that recommendation before this thread. That may just be my blindness in skimming things too quickly. In any case, I think it indicates a wart in the language when you have to wrap everything in otherwise useless let blocks just to get it to parse.