Created
May 4, 2016 11:42
-
-
Save Glorp/ff706667dc14299b43a9a711a1ebc29d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun foo b = | |
let exception Foo | |
in if b | |
then (foo (not b)) handle Foo => "caught" | |
else raise Foo | |
end | |
exception Bar | |
fun bar b = | |
if b | |
then (bar (not b)) handle bar => "caught" | |
else raise Bar |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
(Something like: Each
foo
-call "creates" a newFoo
exn-constructor, so thehandle
, that pattern matches value constructed with "inner"Foo
against "outer"Foo
-pattern, fails. And innerFoo
carries on, uncaught.Bar
is created outside ofbar
, so eachbar
-call deals with sameBar
and things behave more behavedly?)