3 ms·
I really feel like I'm going lengths in order to satisfy the compiler. The compiler should work for me, not the other way around. Why do I need to manually cre
by nialv7 10y ago
I really feel like I'm going lengths in order to satisfy the compiler. The compiler should work for me, not the other way around.
Why do I need to manually create a scope when the compiler can see that variable is never used again afterwards?
In Jill.name().first_name(). Why can't the compiler extend the lifetime of the return value until the end of the statement?
Having a borrow check to ensure memory safety is good. But those are just unnecessary and pointless. These are not pitfalls in user code, but pitfalls in language design
- steveklabnik 10y ago> when the compiler can see If you look at the rest of this thread, you'll see that the compiler _can't_ currently see that; this is the whole issue.
- nialv7 10y agoI wasn't talking about this particular compiler. I meant "in theory, a compiler would be able to see".
- steveklabnik 10y agoThat's fair; as I said elsewhere, we are very interested in making your theory a reality :)
- deleted 10y ago[deleted]