top | item 43234601

(no title)

dbdoskey | 1 year 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 <'_>.

discuss

order

Klonoar|1 year ago

I cannot imagine using syntax that’s largely reserved across languages for array indexing for such a completely unrelated topic.

mmoskal|1 year ago

This comes from ML (as in SML or OCaml), where 'a reads "alpha" and is a type parameter.

j-krieger|1 year ago

> 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.

estebank|1 year ago

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.

dralley|1 year ago

I completely disagree that [$_] looks nicer than <'_>.