Hacker News new | ask | show | jobs
by dbdoskey 473 days ago
(not OP) I love rust, bu I just think that using ' for lifetime was a huge mistake, and using <> for templates (rather than something like []) was a medium mistake.

There is something about how the brain is wired, that using ' for lifetime, just triggers the wrong immediate response to it.

Something like this would look so much nicer IMHO [$_], compared to this <'_>.

4 comments

I cannot imagine using syntax that’s largely reserved across languages for array indexing for such a completely unrelated topic.
This comes from ML (as in SML or OCaml), where 'a reads "alpha" and is a type parameter.
> using <> for templates (rather than something like []) was a medium mistake

I never get this take. Array indexing is done with []. This would just confuse the hell out of me.

It has the benefit of making the parsing of numeric comparisons unambiguous and trivial to parse. You'd use a different syntax for array indexing.
I completely disagree that [$_] looks nicer than <'_>.