Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Indeed. I'd consider the current rendition of Try a magic conversion operator, not so different from IntoInterator (which powers Rust's for each loop sugar) for example, or the IntoFuture mechanism which drives async/await sugar or Display (which turns things into strings).

A user defined function turns your type T into a possibly different type S which has some specific property and then an agreed thing happens to the S, using that property. In some cases your implementation is a no-op, you already did have the desired property, in other cases you must do a lot of work to make it happen.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: