|
|
|
|
|
by needlesslygrim
651 days ago
|
|
I assume it's derived from the OCaml generic type syntax (the first Rust compiler was written in OCaml after all), for example the definition of the type `Option.t` in OCaml: type 'a t = 'a option =
| None
| Some of 'a
I think this is the case because IIRC this function: fn slice<'a>(s: &'a str) -> &'a str { &s[0..2] }
Is generic over the lifetime of `s`, and it I assume it would have been difficult to distinguish generic types and lifetimes. |
|