Function Currying..A beginner's q uestion
Can someone tell me what is wrong in the following code?

    1. def loop(pre: =>Unit) = (cond: =>Boolean): Unit={if (cond) pre
                                                       else ()}
    2. def loop(pre: =>Unit) = (cond: =>Boolean) => ((x:Int): Int=x*x)

    3. def loop(pre: =>Unit)(cond: =>Boolean) = ((x:Int): Unit={()})
   
    4. def loop(pre: =>Unit) => (cond: =>Boolean) => {if (cond) pre
                                                       else ()}

 Thank you all in advance!
Function Currying..A beginner's q uestion
===

Can someone tell me what is wrong in the following code?

    1. def loop(pre: =>Unit) = (cond: =>Boolean): Unit={if (cond) pre
                                                       else ()}
    2. def loop(pre: =>Unit) = (cond: =>Boolean) => ((x:Int): Int=x*x)

    3. def loop(pre: =>Unit)(cond: =>Boolean) = ((x:Int): Unit={()})
   
    4. def loop(pre: =>Unit) => (cond: =>Boolean) => {if (cond) pre
                                                       else ()}

 Thank you all in advance!