Rust pop quiz: if T: Clone, what does x.clone() do when (a) x is &T, (b) x is &&T:
How terrible would it be to code in Rust without auto-deref? What would be the most painful thing?
-
-
Question is underspecified, what else can I change? Autoderef gets invoked quite often.
-
Without autoderef, &self methods wouldn't work.
-
You'd have (&foo).bar() very often. The whole &self thing is kinda designed around autoderef.
-
that's actually autoref isn't it
-
I consider that a part of autoderef (and is part of the reason why the &&T question above is confusing)
-
anyway, I supported having separate . and -> operators like C++, instead of C++ (otherwise all the ergonomics go \
-
/* ARGH. wanted to write: instead of autoderef */
-
I think autoref without autoderef wouldn't be too bad fwiw. Just makes boxes and rcs annoying.
- 5 more replies
New conversation -
-
-
Having written Servo before autoderef, it had a ton of &**. And people just sort of added * and & until it compiled
-
are you talking about autoderef, or about deref coercions? (autoderef is *much* older)
-
I recall deref coercions making Servo code ugly. Wasn't there pre-autoderef
-
how could they make code uglier
-
oh shut up Swift's grammar is 50% devoted to describing closures :P
-
??? No I mean deref coercions literally lead to less code, strictly
-
Oh ok I thought you were saying "Rust can't be uglier" :p
-
That comment was made with a reversed arrow of time. I meant "lack of deref coercions" made code ugly
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.