|
|
|
|
|
by pitterpatter
2602 days ago
|
|
Re: your second example, once upon a time you could write something very similar in Rust: do 5.times {
// ...
}
Where do was just sugar for calling functions that took a closure as the last argument: fn foo(a: A, ..., z: Z, cl: ||) { ... }
foo(a, ..., z, || {
...
})
do foo(a, ..., z) {
...
}
|
|