Re: [julia-users] I noticed there is no do while loop

2014-04-09 Thread David Moon
On Tuesday, April 8, 2014 7:17:18 PM UTC-4, Cameron McBride wrote: I've long enjoyed ruby's `loop` keyword for exactly this type of use. Too bad Julia doesn't have (full featured) macros so you could write loop yourself and just use it without first convincing a whole lot of people it's a

Re: [julia-users] I noticed there is no do while loop

2014-04-09 Thread Stefan Karpinski
You can do `@loop begin ... end` – of course, that's not any shorter than `while true ... end`. On Wed, Apr 9, 2014 at 7:31 PM, David Moon dave_m...@alum.mit.edu wrote: On Tuesday, April 8, 2014 7:17:18 PM UTC-4, Cameron McBride wrote: I've long enjoyed ruby's `loop` keyword for exactly this

Re: [julia-users] I noticed there is no do while loop

2014-04-08 Thread Kevin Squire
Although not too frequent, this would be a good FAQ entry. Cheers, Kevin On Tuesday, April 8, 2014, Pierre-Yves Gérardy pyg...@gmail.com wrote: This does the trick: while true # ... condition || break end On Tuesday, April 8, 2014 5:26:00 AM UTC+2, Freddy Chua wrote: as

Re: [julia-users] I noticed there is no do while loop

2014-04-08 Thread Mike Innes
If while true loops are idiomatic, could we perhaps make the true optional? On Tuesday, 8 April 2014 18:57:53 UTC+1, Stefan Karpinski wrote: Good idea. For what it's worth, these days I would be perfectly happy to only program with while true loops and explicit breaks. On Apr 8, 2014, at

Re: [julia-users] I noticed there is no do while loop

2014-04-08 Thread Stefan Karpinski
Eh, doesn't seem that hard to write `while true` and `while` by itself is kind of confusing. I also don't necessarily think this is how everyone should write loops, but I increasingly find myself starting out by writing `while true` and then putting conditions where they are needed as I go. Then

Re: [julia-users] I noticed there is no do while loop

2014-04-08 Thread Cameron McBride
I've long enjoyed ruby's `loop` keyword for exactly this type of use. Cameron On Tue, Apr 8, 2014 at 4:28 PM, Stefan Karpinski ste...@karpinski.orgwrote: Eh, doesn't seem that hard to write `while true` and `while` by itself is kind of confusing. I also don't necessarily think this is how

[julia-users] I noticed there is no do while loop

2014-04-07 Thread Freddy Chua
as stated in question..

Re: [julia-users] I noticed there is no do while loop

2014-04-07 Thread Stefan Karpinski
That is correct. On Mon, Apr 7, 2014 at 11:26 PM, Freddy Chua freddy...@gmail.com wrote: as stated in question..