I'm in a similar position to Dean, being new to the language but have
studied the docs quite a bit. I have to agree that the sample he posted is
rather intimidating.
There are a few things about it:
I find the syntax for lifetimes to be quite hard to get used to since it
overloads the & operator to mean something different, and because the
convention seems to be to name the lifetime 'self' inside methods, which
overloads that meaning as well. So now just in the method signature you
have &self in three places that mean two separate things. All of the
casting (is it casting?, I'll use that term as I don't know the correct
one. ) to local variables with said lifecycle, is also a bit noisy and hard
to parse. It would be nice if there was syntax such that the lifecycle
could be applied as the variables are bound in the match deconstruction.
And couldn't the types be inferred in the casting case such that the
lifecycle doesn't need to have the type after the slash, if the point of
the casting is just to specify the lifecycle it would be nice if there was
a syntax to specify the lifecycle without repeating the type info of the
operand.

I hope my suggestions make at least a bit of sense. I'm sorry, its quite
the challenge to talk about a language when you don't have all the
vocabulary down.
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to