Hacker News new | past | comments | ask | show | jobs | submit login

In Scala you can do:

    while { prepare; condition } 
    do { process }
This runs all 3 in order every iteration but quits if condition evaluates to false. It just uses the fact that value of a block is the value of the last expression in the block.

Scala has a lot of syntax goodies although some stuff is exotic. For example to have a 'break' you need to import it and indicate where from exactly you want to break out of.






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

Search: