by vilya · 14y ago · 0 comments
I hope there's something I've missed. I've been quite impressed by the rest of the language so far & it would be a shame if they got this wrong.
fn foo(f: fn()) {
log(info, "calling f");
f();
log(info, "called f");
}
fn bar() {
log(info, "calling foo");
foo({||
ret;
});
log(info, "called foo");
}
I'm not clear on whether the ret would return from foo or from bar - or whether it would be a compile error.BTW thanks for taking the time to reply - I appreciate it!
`ret` in block functionThat said, perhaps there is something you've missed. I've posted links to the Rust mailing list elsewhere in this thread, could you skim over those and let me know if they address your concerns? Honestly I'm not super-thrilled at this change myself, if only because it makes for loop invocations a bit busier to look at, but I can't say that I fully understand the semantic tradeoffs here.
http://smallcultfollowing.com/babysteps/blog/2012/04/06/for-...