I wasn't saying the implementation sounded freaky.  I was just imagining
looking at a 30,000 line Rust source file with large fn definitions and
trying to figure out whether each one is a block with interesting side
effects through the mutable closure or not.


On Fri, Dec 23, 2011 at 4:06 AM, Marijn Haverbeke <[email protected]> wrote:

> > The idea that a fn (no closure) could implicitly turn into a block
> (mutable
> > closure) seemed freaky when I read the tutorial.
>
> There is no actual allocation going on -- the function pointer is
> paired with a null environment pointer, and that's the closure. You
> pay nothing, and since a (non-closing) fn can't do anything that a
> closure couldn't do, I'm not sure why you'd call this freaky.
>
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to