Re: [rust-dev] On Copy = POD

2014-06-22 Thread Paulo Sérgio Almeida
On 21 June 2014 22:03, Igor Bukanov wrote: > On 20 June 2014 21:07, Paulo Sérgio Almeida wrote: > > I have seen many other examples, where the code could mislead the reader > into > > thinking there are several, e.g., Mutexes: > > > > let mutex = Arc::new(

Re: [rust-dev] On Copy = POD

2014-06-22 Thread Paulo Sérgio Almeida
compiler. There's little point in having a > powerful and extensible language if even simple types need hardcoded > compiler magic to function. > > > On Sat, Jun 21, 2014 at 7:42 AM, Paulo Sérgio Almeida < > pssalme...@gmail.com> wrote: > >> Regarding the wh

Re: [rust-dev] On Copy = POD

2014-06-21 Thread Paulo Sérgio Almeida
gt;>> this, I would rather go back to having @-pointers). The trouble is, I see >>> incrementing a ref count as the upper bound on the work that should be done >>> in a copy constructor and I see no way to enforce that. >>> >>> So, I guess +1 to spirit of t

Re: [rust-dev] On Copy = POD

2014-06-21 Thread Paulo Sérgio Almeida
Regarding the white-listing, I also find it weird, but should the user experience be worse just because Rc and Arc are implemented in Rust and so we should do nothing in the name of orthogonality? A user won't care if Arc and Rc are built-in or not. I may have passed the message that its only ugli

[rust-dev] On Copy = POD

2014-06-20 Thread Paulo Sérgio Almeida
Hi all, Currently being Copy equates with being Pod. The more time passes and the more code examples I see, it is amazing the amount of ugliness that it causes. I wonder if there is a way out. There are two aspects regarding Copy: the semantic side and the implementation side. On the more abstrac

Re: [rust-dev] Interaction between private fields and auto-dereferencing

2014-05-24 Thread Paulo Sérgio Almeida
Nice! On 24 May 2014 12:42, Huon Wilson wrote: > I believe much of the underlying issue is covered by #12808. I have just > filed a pull request #14402 to "fix" the immediate symptoms of this bug by > making it harder to accidentally have struct fields taht conflict with the > private fields o

Re: [rust-dev] Interaction between private fields and auto-dereferencing

2014-05-24 Thread Paulo Sérgio Almeida
you filed an issue on the > GitHub issues page? https://github.com/mozilla/rust/issues/new > > -Kevin > > On May 23, 2014, at 6:04 AM, Paulo Sérgio Almeida > wrote: > > Hi all, (resending from different email address; there seems to be a > problem with my other add

[rust-dev] Interaction between private fields and auto-dereferencing

2014-05-23 Thread Paulo Sérgio Almeida
Hi all, (resending from different email address; there seems to be a problem with my other address) I don't know if this has been discussed, but I noticed an unpleasant interaction between private fields in the implementation of things like pointer types and auto-dereferencing. The example I

Re: [rust-dev] Simplifying lifetime expression

2013-04-23 Thread Paulo Sérgio Almeida
} else { None } } could be written as: fn next(iter: &Iterator) -> Option<&T> { iter.index += 1; if iter.index < iter.source.len() { Some(&iter.source[iter.index]) } else { None

Re: [rust-dev] Simplifying lifetime expression

2013-04-23 Thread Paulo Sérgio Almeida
particularly true for "non-library" code, and even more true with judicious use of `@` pointers (it is often not worth the trouble to avoid the GC; it can make life much easier, that's what it's there for). So in summary I do not think it likely we will change the curren

Re: [rust-dev] Simplifying lifetime expression

2013-04-22 Thread Paulo Sérgio Almeida
On 4/22/13 5:48 PM, Diggory Hardy wrote: Please don't use HTML when posting to lists. Sorry. I hope this one goes in plain text. (Added a text domain to Thunderbird.) 2) function parameter types or return type that are not type parameters have all the same implicit lifetime by default, but they

[rust-dev] Simplifying lifetime expression

2013-04-22 Thread Paulo Sérgio Almeida
Hi all, (My first post here.) First, congrats for what you are trying to achieve with Rust. I arrived very late to the party, and so I am not sure that what I will say can be of use. But as I understand, lifetimes is one of those things that are not completely solidified, and anyway, better la