I also like 'do 10,times {' , since I likely would also use it to create
multiple copies (one after the other). A lazy sequence for my purposes
dealing with data generation.
Just to clarify, 'do 10.times {' would NOT allow launching multiple copies
in parallel, correct ? (that's reserved for Actor styles, etc, etc.) Just
simple repetition, as you say ?
On Thu, Jul 25, 2013 at 3:46 PM, Benjamin Striegel
<[email protected]>wrote:
> > If we did that, we'd lose the ability to break or return, since 'do'
> doesn't follow the for-style loop protocol.
>
> I'm perfectly happy with that; the `times` method was never about complex
> control flow, just simple repetition. `do 10.times {` is a delightfully
> self-explanatory contract.
>
> And just as evidence that `do` notation is useful beyond `spawn`:
>
> $ git grep "do .*{" -- "*.rs" | wc -l
> 2019
> $ git grep "do .*spawn" -- "*.rs" | wc -l
> 274
>
> > we're likely to switch that to a macro call that passes
> explicitly-captured arguments into a thunk struct that owns the explicit
> captures
>
> I don't remember seeing much of this idea in the meeting notes, but I do
> remember seeing it mentioned in these blog posts (for those who want more
> context):
>
> http://smallcultfollowing.com/babysteps/blog/2013/05/30/removing-procs/
> http://smallcultfollowing.com/babysteps/blog/2013/06/03/more-on-fns/
>
> _______________________________________________
> Rust-dev mailing list
> [email protected]
> https://mail.mozilla.org/listinfo/rust-dev
>
>
--
-Thad
Thad on Freebase.com <http://www.freebase.com/view/en/thad_guidry>
Thad on LinkedIn <http://www.linkedin.com/in/thadguidry/>
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev