logo CodeStepByStep logo


Language/Type: ML value mystery
Author: Dan Grossman (added by Melissa Hovik on 2018/01/19)

Give the value ans is bound to after evaluation.

val x = 1
fun f y =
    if y > 2
    then fn z => x + z
    else fn z => x - z
val x = 3
val g = f 4
val x = 5
val ans = g 6
ans =

You must log in before you can solve this problem.

Log In

Need help?

If you do not understand how to solve an exercise or why your solution doesn't work, please contact your TA or instructor.
If something seems wrong with the site (errors, slow performance, incorrect tests, etc.), please

Is there a problem? Contact a site administrator.

©, all rights reserved.