• [^] # Re: Dommage...

    Posté par (site web personnel) . En réponse à la dépêche OCaml 3.10.0 est sorti. Évalué à 3.

    en python :
    >>> if 1 > 2:
    ... "toto" + 1
    ... else:
    ... 1 + 1
    ... ^D
    2
    >>> 
    
    en OCaml :
    # if 1 > 2 then
     "toto" + 1
     else
     1 + 1;;
    This expression has type string but is here used with type int
    # 
    
    ("toto" est souligné) Donc on voit bien qu'en python, le code marchera jusqu'au jour où le test donnera "true", alors qu'en OCaml, il ne compile même pas...