} } This defines a type, Foo, which has four associated functions. The first, Foo::new(), is not an instance function and must be specified with the type prefix. The remaining three all take a self parameter in a variety of ways, and can be called on a Foo instance using the dot-notation syntax sugar, which is equivalent to calling the type-qualified function name with an explicit self first parameter. let mut foo = Foo::new(); // must called as a type-specified function foo.refer(); // prints "0". Foo::refer() has read-only access to the foo instance foo.mutate(5); // mutates foo in place, permitted by the &mut specification, need foo to be declared mut foo.consume(); // prints "5" and destroys foo, as Foo::consume() takes full ownership of self // equivalent to foo.refer() Foo::refer(foo); // compilation error: foo is out of scope Self The Self language is named after this use of "self". Xbase++ Self is strictly used within methods of a class. Another way to refer to Self is to use ::. See also References Further reading Meyers, Scott, 1995. More Effective C++: 35 New Ways to Improve Your Programs and Designs. Scott Meyers Stroustrup, Bjarne, 1994. The Design and Evolution of C++. Addison-Wesley Pub. Co. Bjarne Stroustrup Object-oriented programming