On Sun, Jul 28, 2013 at 11:54 PM, Daniel Micay <[email protected]> wrote: > On Sun, Jul 28, 2013 at 4:54 PM, Brian Anderson <[email protected]> wrote: >> FWIW I prefer the terms box and reference. I don't really understand the >> idea that only * is 'semantically a pointer' though. > > Unique boxes can be implemented without a pointer as long as the type > is no larger than the slot needed to contain a pointer-size object. > The pointer itself just isn't part of the type's contract, since > there's no pointer arithmetic.
Hmm. Given immutability, in the absence of Cell or destructors, ditto for &T and @T? Do we even specify that it will be pointer-sized? Kind of amusing: you could have &&&&@@~~@@~~int with the same representation as int, and "dereferencing" at each level just transmute(self). It may look like this is only of theoretical interest, because no one in their right mind would pass int by pointer, but it would be a useful optimization for generic code - for the same reason. -- Your ship was destroyed in a monadic eruption. _______________________________________________ Rust-dev mailing list [email protected] https://mail.mozilla.org/listinfo/rust-dev
