Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Following up with compile time of a few variations.

    let result:Double = -(1 + 1) + -(1 + 1) - 1 // 10.829s
    let result:Double = -(1 + 1) + -(1 + 1)     // 1.724s
    let result:Double =  (1 + 1) +  (1 + 1) - 1 // 1.721s
    let result:Double = -(1 + 1)            - 1 // 0.763s
    let result:Int    = -(1 + 1) + -(1 + 1) - 1 // 0.571s

    let result:Double = -(1 + 1) + -(1 + 1) + 1
    //error: the compiler is unable to type-check this expression in reasonable time; try breaking up the expression into distinct sub-expressions


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: