On Wed, Nov 20, 2013 at 7:37 PM, Brian Anderson <bander...@mozilla.com>wrote:

> On 11/20/2013 09:14 AM, Niko Matsakis wrote:
>
>> On Tue, Nov 19, 2013 at 07:19:15AM -0800, Patrick Walton wrote:
>>
>>> The liveness analysis uses the infinite nature of `loop`, and it was
>>> felt that special-casing the `true` boolean like Java does is a hack.
>>>
>> I personally like `loop`. It reads nicely. It happens quite frequently
>> that I have a loop that works out best if I test the condition in the
>> middle, rather than the front or the end, or where the condition is
>> something quite involved; in such situations, `loop { ... }` is
>> perfect, and `while true { ... }` always feels second-class. I
>> recognize this is silly of me, though. :)
>>
>>
>>
> I also adore `loop` and rarely use `while`. I write code like this
> constantly:
>
> loop {
>     match port.recv() {
>         case DoSomething => { }
>         case Exit => break
>
>     }
> }
>

This is an even sillier idea, but then what about keeping `loop` and
dropping `while`?




>  _______________________________________________
> Rust-dev mailing list
> Rust-dev@mozilla.org
> https://mail.mozilla.org/listinfo/rust-dev
>



-- 
Your ship was destroyed in a monadic eruption.
_______________________________________________
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to