Hi,
Does Rust macro have flow control based on a variable value?
I didn't find such info here http://doc.rust-lang.org/guide-macros.html.
I'd like to get a macro expading a for loop.
doTimes(3, println!(""))
=>
println!("")
println!("")
println!("")
--
Daneel S. Yaitskov
___
Hello all. I just subscribed to this list only because I found something
odd on the Rust Guide, and couldn't find a better place to send feedback.
It's about section 13 "Standard Input". The first example code is the
following:
use std::io;
fn main() {
println!("Type something!");
Yup, that leading std:: in main shouldn't be there.
___
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev
Hi Pablo,
You can submit a pull request at the Rust Github repo (
https://github.com/rust-lang/rust). The relevant file is at `/src/doc/
guide.md`: https://github.com/rust-lang/rust/blob/master/src/doc/guide.md.
Cheers,
Tim Dumol
On Thu, Sep 18, 2014 at 3:55 AM, Steve Klabnik
wrote:
> Yup, th
Rust community living up to its fame of awesomeness!
Thanks for that. The pull request is already on the queue.
On 17 September 2014 20:58, Tim Joseph Dumol wrote:
> Hi Pablo,
>
> You can submit a pull request at the Rust Github repo (
> https://github.com/rust-lang/rust). The relevant file is
The problem is that you're trying to use a trait as a type. This code works
for me
```
use std::rand::{Rng, task_rng};
fn main() {
let rng = &mut task_rng();
print_numbers(rng);
}
fn print_numbers(r: &mut T) {
for _ in range(0u, 10) {
println!("{}", r.gen::());
}
}
```
-
On Wed, Sep 17, 2014 at 2:26 PM, Evan Davis wrote:
>
> The problem is that you're trying to use a trait as a type.
>
That shouldn't be a problem. You can use a `&mut Trait`, and you'll get
dynamic dispatch.
___
Rust-dev mailing list
Rust-dev@mozilla.or