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

As my sibling says, it was there before me. Ruby and smalltalk also use this syntax, so it’s not without precedence.

As for lifetimes, that syntax is from OCaml, though they use it for something else. “life” and “lt” seem too short, “span” is overloaded. We tried to explore options but none were clearly better, so we kept what we had.



> As for lifetimes, that syntax is from OCaml, though they use it for something else.

I hadn't noticed the similarity but it makes sense. This is the OCaml syntax for generics, eg:

    type 'a list_with_generic = 'a list;


Yeah, it's also not as different as it sounds, as lifetimes are fundamentally generics, just of a different kind than types.




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

Search: