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

Does not Interface{} work as well as Any? I mean, most languages have while-statements cause it is more clear what the intention is.


Some languages even have real for statements because it makes more clear what the intention is.

In Pascal, you can’t break out of a for statement, the limit and step value are evaluated only at start of the loop, and you can’t change the value of the variable being looped over.

Consequently, the number of iterations through the loop taken is known when the loop gets entered.


It does, but with generics coming down the pipe, I feel that "any" expresses intent somewhat better in certain circumstances. Or at least it ought to improve readability-at-a-glance.

I'd imagine you can continue using interface{} for the foreseeable future.


OTOH there’s no ‘while true’ or do-while or while-do, none of which are particularly fluent.




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

Search: