@wycats You mention that borrowed refs are the default when writing a function. I wonder why thats not the default case then, no & needed
@evanphx but having sigil-less sometimes mean by-val and sometimes by-ref seems skeeery.
-
-
@wycats Yeah, I agree it too easily confuses the programmer. -
@evanphx interestingly, I have definitely found myself forming an intuition for "value types" after a while. -
@wycats Oh yeah, thats common in all langs with them. I do the same in C++ and Go. -
@evanphx makes sense. Harder to form the intuition in Ruby/JS/Java because "reference all the things" is a dictate. -
@wycats Yeah, even for things you want to be a Value, like a Pathname. -
@evanphx I'm Rust, Path is actually not Copy because it has a heap allocated string in it. Aliasing is disallowed so things are a bit diff. -
@wycats Because a copy would mean copying the heap allocated string? -
@evanphx it would mean copying the pointer to the heap allocated string, which would be an alias. Rust has clone too, but not automatic. - 8 more replies
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.