Comment

Comment by ignoramous

Also, is doing flow control using exceptions an acceptable pattern in the OCaml world?

Like in Java:

  try {
     print(awesomeObj.getSomeState());
  } catch(NullPointerException npe) {
     awesomeObj = AwesomeObj.getInstance();
  }

would be considered very bad. You would instead be expected to do:

   if (awesomeObj == null) awesomeObj = AwesomeObj.getInstance();
   print(awesomeObj.getSomeState());

(how do you <code-wrap> stuff on here?)
parent ignoramous 11 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton