3 ms·
Indeed, this is the approach taken in many languages with reference counted types. One problem is that the user would have no way of naming the thing that the
by barrkel 10y ago
Indeed, this is the approach taken in many languages with reference counted types.
One problem is that the user would have no way of naming the thing that the lifetime is attached to. Diagnostic messages when trying to hand off 'name' to other code could be perplexing, as the delta between broken code and working code would be larger.
- Groxx 10y agoGiven their current error messages, that doesn't seem like a problem. If you must name it, call it `name'` or something, but the output could easily be something like 28 | let name = jill.name().first_name(); | ----------- value returned here 28 | let name = jill.name().first_name(); | ^^^^^^^^^^^^^ leaves scope before use, | and is unavailable here