Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle runtime exceptions #9

Closed
lancelote opened this issue Jun 17, 2021 · 0 comments
Closed

Handle runtime exceptions #9

lancelote opened this issue Jun 17, 2021 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@lancelote
Copy link
Owner

lancelote commented Jun 17, 2021

Example implementation file

fun max1(xs : int list) =
  if null xs
  then NONE
  else
    let val tl_ans = max1(tl xs)
    in if isSome tl_ans andalso valOf tl_ans > hd xs
       then tl_ans
       else SOME (hd xs)
    end

... test file

val test3 = valOf(max1 []);

... result

uncaught exception Option
  raised at: smlnj/init/pre-perv.sml:25.28-25.34

sml-test reports nothing.

@lancelote lancelote added the bug Something isn't working label Jun 17, 2021
@lancelote lancelote self-assigned this Jun 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant