• # Argh

    Posté par . En réponse au journal Is return the new goto ?. Évalué à -5.

    Quand je vois ça :

    scala> def pof(i: Int) : Int = { i + 1 };
    pof: (i: Int)Int

    scala> pof(1)
    res0: Int = 2

    scala> def pif(i: Int) : Int = {
    | val pouf : Int = i - 1;
    | pouf + 1
    | }
    pif: (i: Int)Int

    scala> pif(1)
    res1: Int = 1

    scala> def pouet(i: Int) : Int = {
    | if(i == 0 ){return -1}
    | i
    | }
    pouet: (i: Int)Int

    scala> pouet(0)
    res2: Int = -1

    je me souviens pourquoi j’aime Python...