[rust-dev] Getter and setters

David Bruant bruant.d at gmail.com
Sun Jul 22 04:15:25 PDT 2012


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
> <http://en.wikipedia.org/wiki/Object-oriented_programming> programming
> languages <http://en.wikipedia.org/wiki/Programming_language>, is a
> special sort of class
> <http://en.wikipedia.org/wiki/Class_%28computer_science%29> member,
> intermediate between a field
> <http://en.wikipedia.org/wiki/Field_%28computer_science%29> (or data
> member <http://en.wikipedia.org/wiki/Data_member>) and a method
> <http://en.wikipedia.org/wiki/Method_%28computer_science%29>.
> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/rust-dev/attachments/20120722/f7d138f6/attachment.html>


More information about the Rust-dev mailing list