Question: 2. Given the following ML code: run whatoutput s = - str (hd (tl (tl (explode s)))) i When the function is called as what_output

 2. Given the following ML code: run whatoutput s = -

2. Given the following ML code: run whatoutput s = - str (hd (tl (tl (explode s)))) i When the function is called as what_output "hello" what happens? In other words, show what happens at each step (i.e. what is the result of (explode s) 2...what happens when tl is applied to that result? and so on.), and indicate the final result that the function evaluates to. (Note: feel free to try this in ML to check your results.) 3. Examine the following ML. code. fun what do I do to this = if null to this then 0 else hd (to_this) + what_do_I_do (tl to_this) (a) Describe what this function does, in Englislh. b) If this function is called as what do do 12,2,3, 4,51, what is the result

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!