2006-11-06

what's wrong with this picture?


let () =
Arg.parse specl anonfun usage_msg;
match List.rev !anonargs with
| [] -> Arg.usage specl usage_msg; exit 1
| args ->
begin
match !conf with None -> () | Some conf -> do_config conf;
let string = "world" in
printf "hello %s\n%!" string;
end

2 comments:

  1. No conf!? Goodbye world!

    (Answer: your indentation mode is misleading :P)

    ReplyDelete
  2. > (Answer: your indentation mode is misleading :P )

    I guess that's one way of looking at it. If you'd asked me, though I would have said OCaml's syntax is broken.

    If OCaml required a terminator for match and if expressions, my #1 source of silly bugs would go away.

    ReplyDelete