There are no real cons..it gets compiled out.

The big pros to me are put a break point on them and access control (
which can be different between read and write) . However I'm not sure
how to do private field / public property  ( get function) in Rust .

Ben

On Sun, Jul 22, 2012 at 7:15 PM, David Bruant <bruan...@gmail.com> wrote:
> Le 22/07/2012 12:56, Matthieu Monrocq a écrit :
>
> Hi,
>
> It sounds to me like properties =>
> http://en.wikipedia.org/wiki/Property_%28programming%29
>
> A property, in some object-oriented programming languages, is a special sort
> of class member, intermediate between a field (or data member) and a method.
> Properties are read and written like fields, but property reads and writes
> are (usually) translated to get and set method calls.
>
> Is this what you wanted to express ?
>
> The definition seems close to what I described indeed :-)
> Does Rust already have support for these?
>
> What's missing from the wikipedia page is a pro/con analysis. I've described
> pros in my initial message, I'm curious of arguments against properties.
>
> Thanks,
>
> David
>
> _______________________________________________
> Rust-dev mailing list
> Rust-dev@mozilla.org
> https://mail.mozilla.org/listinfo/rust-dev
>
_______________________________________________
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to