Princeton University |
Computer Science 441 |
((if is_zero(((fn y => pred y)1)) then succ else pred) ((fn y => (pred(pred y)))8))
- convert "301"; val it = 49 : int -convert "89"; val it = 89: int -convert "1234"; val it = 194 : int - convert "11111111"; val it = 255 : int -convert "90A3"; uncaught exception exception RangeNote that the conversion bases were 4, 10, 5, and 2, respectively.
b. Compare this function with a similar function written without using exceptions. (You don't have to write it - just talk about it's general structure!) Comment on clarity and efficiency at least.