Question 24 Translate the following code so that only tail function calls are made using continuation passing. If you use a language that is not ML, please indicate which language. fun insert(x, nil) = [x] | insert(x, y1::y2) = if (x = y1) then y1:y2 else y1:insert(x, y2); fun process(x,y) = if (x > 100) then 100 :: process(x-100,y) else insert(x,y); Edit View Insert Format Tools Table | B IU A v 2v T²v: 12pt v Paragraph v
Question 24 Translate the following code so that only tail function calls are made using continuation passing. If you use a language that is not ML, please indicate which language. fun insert(x, nil) = [x] | insert(x, y1::y2) = if (x = y1) then y1:y2 else y1:insert(x, y2); fun process(x,y) = if (x > 100) then 100 :: process(x-100,y) else insert(x,y); Edit View Insert Format Tools Table | B IU A v 2v T²v: 12pt v Paragraph v
Related questions
Question
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps