![]() |
.. (לתיקייה המכילה) | |
Can we use previously defined functions (which are not auxiliary) in questions where the usage of an auxiliary function is not allowed? | |
Yes. You may, and in fact you should (also in questions where auxiliary functions are allowed). This is code reuse, which you should try to achieve, as the general directions to the HW state. |
Can we use `Let' in order to define local auxiliary functions when global ones are not allowed? | |
No you cannot. |
Can you add an example to 3.2? | |
Here is some interaction with the required function: - val f0 = sumsumf 0; val f0 = fn : int -> int - f0 1; val it = 1 : int - f0 2; val it = 3 : int - f0 3; val it = 6 : int - val f1 = sumsumf 1; val f1 = fn : int -> int - f1 1; val it = 1 : int - f1 2; val it = 4 : int - f1 3; val it = 10 : int - val f2 = sumsumf 2; val f2 = fn : int -> int - f2 1; val it = 1 : int - f2 2; val it = 5 : int - f2 3; val it = 15 : int - |