Comment by scotty79
3 months ago
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.
No comments yet
Contribute on Hacker News ↗