@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 what would the by-val sigil be? I think it's largely inherited from C++ tbh, but there may be composition reasons.
-
-
@wycats Perhaps *, drawing on the meaning of deref into value. -
@evanphx hm. * is used in the unsafe dialect to mean raw pointer (basically syntactic FFI API). Evolution is interesting. -
@wycats Yeah. Because "by value" was the default in C, there is no common sigil for it. Perhaps ^ to mean "copy into this scope". -
@evanphx also, simple values make sense to by-value in Rust. Integers are still common ;) -
@wycats Yeah. That's a place where you want by-value. I've considered a lang where type defined what the "sigil-less" meaning was. -
@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. - 14 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.