( handler | 2014. 09. 24., sze – 10:33 )

OCaml-ben valoban nem koltseges az exception, igy eloszerettel hasznaljak, akar control-flow muveletekre is.

.NET-ben, es Java-ban a stack trace osszegyujtese draga muvelet, es esetenkent az objektum letrehozasa sem elfogadhato (pl.: numerikus kod kernel), de ugyes megoldasokkal ezek a muveletek sokszor megsporolhatok (pl.: javaban java.lang.Throwable::fillInStackTrace override eseten).

Kapcsolatos jvm opcio:

"The compiler in the server VM now provides correct stack backtraces for all "cold" built-in exceptions. For performance purposes, when such an exception is thrown a few times, the method may be recompiled. After recompilation, the compiler may choose a faster tactic using preallocated exceptions that do not provide a stack trace. To disable completely the use of preallocated exceptions, use this new flag:
-XX:-OmitStackTraceInFastThrow."

.NET 4.5-be sem veletlenul kerult bele a ExceptionDispatchInfo.

https://connect.microsoft.com/VisualStudio/feedback/details/633822/allo…

Event-Based Programming without Inversion of Control Philipp Haller and Martin Odersky:

http://lampwww.epfl.ch/~odersky/papers/jmlc06.pdf